aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/connection_links_spec.rb
diff options
context:
space:
mode:
authorLuc Donnet2015-01-05 14:56:12 +0100
committerLuc Donnet2015-01-05 14:56:12 +0100
commit3bc6d313bebdc1f03e4021aabbc774a0cd97d938 (patch)
treeac5b8c6d8309012136606d9fd9b9a00290f486a8 /spec/features/connection_links_spec.rb
parente632a4634b1762f4c73d11f1e5b127de9832a1ff (diff)
downloadchouette-core-3bc6d313bebdc1f03e4021aabbc774a0cd97d938.tar.bz2
Initialize rails 4 migration
Diffstat (limited to 'spec/features/connection_links_spec.rb')
-rw-r--r--spec/features/connection_links_spec.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/features/connection_links_spec.rb b/spec/features/connection_links_spec.rb
new file mode 100644
index 000000000..985aba7a6
--- /dev/null
+++ b/spec/features/connection_links_spec.rb
@@ -0,0 +1,56 @@
+# -*- coding: utf-8 -*-
+require 'spec_helper'
+
+describe "ConnectionLinks", :type => :feature do
+ login_user
+
+ let!(:connection_links) { Array.new(2) { create(:connection_link) } }
+ subject { connection_links.first }
+
+ describe "list" do
+ it "display connection_links" do
+ visit referential_connection_links_path(referential)
+ expect(page).to have_content(connection_links.first.name)
+ expect(page).to have_content(connection_links.last.name)
+ end
+
+ end
+
+ describe "show" do
+ it "display connection_link" do
+ visit referential_connection_links_path(referential)
+ click_link "#{connection_links.first.name}"
+ expect(page).to have_content(connection_links.first.name)
+ end
+
+ it "display map" do
+ allow(subject).to receive(:stop_areas).and_return(Array.new(2) { Factory(:stop_area) })
+ visit referential_connection_links_path(referential)
+ click_link "#{connection_links.first.name}"
+ expect(page).to have_selector("#map", :class => 'connection_link')
+ end
+
+ end
+
+ describe "new" do
+ it "creates connection_link and return to show" do
+ visit referential_connection_links_path(referential)
+ click_link "Ajouter une correspondance"
+ fill_in "Nom", :with => "ConnectionLink 1"
+ fill_in "Identifiant Neptune", :with => "test:ConnectionLink:1"
+ click_button("Créer correspondance")
+ expect(page).to have_content("ConnectionLink 1")
+ end
+ end
+
+ describe "edit and return to show" do
+ it "edit connection_link" do
+ visit referential_connection_link_path(referential, subject)
+ click_link "Modifier cette correspondance"
+ fill_in "Nom", :with => "ConnectionLink Modified"
+ click_button("Modifier correspondance")
+ expect(page).to have_content("ConnectionLink Modified")
+ end
+ end
+
+end