Last active
January 26, 2017 22:12
-
-
Save Arcolye/bb5b95bee1d66f241b989971b122d066 to your computer and use it in GitHub Desktop.
GoToStudy - Agency Office Spec
This file contains hidden or 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' | |
feature "AgencyOffice" do | |
let(:agency) { create(:agency) } | |
scenario "makes agency visible on relevant country page" do | |
visit country_path(agency.offices.first.country) | |
expect(page).to have_content agency.name | |
end | |
context "on university page" do | |
let(:university) { create :university } | |
before(:each) { | |
create :agency_university_contract, agency: agency, university: university | |
} | |
scenario "makes agency visible for local users" do | |
set_user_country(agency.offices.first.country) | |
visit university_path(university, locale: nil) | |
expect(page).to have_content agency.name | |
end | |
scenario "keeps agency invisible for non-local users" do | |
other_country = create :country | |
set_user_country(other_country) | |
visit university_path(university, locale: nil) | |
expect(page).not_to have_content agency.name | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment