Created
June 12, 2013 14:13
-
-
Save rianrainey/5765627 to your computer and use it in GitHub Desktop.
Rspec Shared Examples with Rails URL Helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
# ... | |
# Include url_helpers for Shared Examples | |
config.include Rails.application.routes.url_helpers | |
# ... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe "Organizations Index View" do | |
it_should_behave_like "allow only super admins", { :controller => Admin::OrganizationsController, | |
:target_path => :admin_organizations_path, | |
:redirect_path => :new_user_session_path } | |
context "when user is a super admin" do | |
it_should_behave_like "an admin index page" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment