diff options
Diffstat (limited to 'spec/features')
| -rw-r--r-- | spec/features/connection_links_spec.rb | 2 | ||||
| -rw-r--r-- | spec/features/lines_spec.rb | 8 | ||||
| -rw-r--r-- | spec/features/networks_spec.rb | 12 | ||||
| -rw-r--r-- | spec/features/stop_areas_spec.rb | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/spec/features/connection_links_spec.rb b/spec/features/connection_links_spec.rb index d77189d41..788e58326 100644 --- a/spec/features/connection_links_spec.rb +++ b/spec/features/connection_links_spec.rb @@ -24,7 +24,7 @@ describe "ConnectionLinks", :type => :feature do end it "display map" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) }) + allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_connection_links_path(referential) click_link "#{connection_links.first.name}" expect(page).to have_selector("#map.connection_link") diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb index 104d45b99..cdf38f97a 100644 --- a/spec/features/lines_spec.rb +++ b/spec/features/lines_spec.rb @@ -4,10 +4,10 @@ require 'spec_helper' describe "Lines", :type => :feature do login_user - let!(:network) { Factory(:network) } - let!(:company) { Factory(:company) } - let!(:lines) { Array.new(2) { Factory(:line_with_stop_areas, :network => network, :company => company) } } - let!(:group_of_line) { Factory(:group_of_line) } + let!(:network) { create(:network) } + let!(:company) { create(:company) } + let!(:lines) { Array.new(2) { create(:line_with_stop_areas, :network => network, :company => company) } } + let!(:group_of_line) { create(:group_of_line) } subject { lines.first } describe "list" do diff --git a/spec/features/networks_spec.rb b/spec/features/networks_spec.rb index ec65209eb..c2433f04e 100644 --- a/spec/features/networks_spec.rb +++ b/spec/features/networks_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe "Networks", :type => :feature do login_user - let!(:networks) { Array.new(2) { Factory(:network) } } + let!(:networks) { Array.new(2) { create(:network) } } subject { networks.first } describe "list" do @@ -18,14 +18,14 @@ describe "Networks", :type => :feature do describe "show" do it "display network" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) }) + allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_networks_path(referential) click_link "#{networks.first.name}" expect(page).to have_content(networks.first.name) end it "display map" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) }) + allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_networks_path(referential) click_link "#{networks.first.name}" expect(page).to have_selector("#map.network") @@ -35,7 +35,7 @@ describe "Networks", :type => :feature do describe "new" do it "creates network and return to show" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) }) + allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_networks_path(referential) click_link "Ajouter un réseau" fill_in "network_name", :with => "Network 1" @@ -48,7 +48,7 @@ describe "Networks", :type => :feature do describe "edit and return to show" do it "edit network" do - allow(subject).to receive(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) }) + allow(subject).to receive(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) visit referential_network_path(referential, subject) click_link "Modifier ce réseau" fill_in "network_name", :with => "Network Modified" @@ -60,7 +60,7 @@ describe "Networks", :type => :feature do # describe "delete", :js => true do # it "delete network and return to the list" do - # subject.stub(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) }) + # subject.stub(:stop_areas).and_return(Array.new(2) { create(:stop_area) }) # visit referential_network_path(referential, subject) # click_link "Supprimer ce réseau" # page.evaluate_script('window.confirm = function() { return true; }') diff --git a/spec/features/stop_areas_spec.rb b/spec/features/stop_areas_spec.rb index ff5a73438..404298b97 100644 --- a/spec/features/stop_areas_spec.rb +++ b/spec/features/stop_areas_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' describe "StopAreas", :type => :feature do login_user - let!(:stop_areas) { Array.new(2) { Factory(:stop_area) } } + let!(:stop_areas) { Array.new(2) { create(:stop_area) } } subject { stop_areas.first } describe "list" do |
