aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/lines_spec.rb
diff options
context:
space:
mode:
authorLuc Donnet2015-02-09 16:01:02 +0100
committerLuc Donnet2015-02-09 16:01:02 +0100
commit138ac002693df4d8af5f5b1a7af12f4042fab297 (patch)
treed7096b54b2820eeb5f39e5ae368fcac033056a6e /spec/features/lines_spec.rb
parent212451cd1f0df5f15595a2a65883a84a88682741 (diff)
downloadchouette-core-138ac002693df4d8af5f5b1a7af12f4042fab297.tar.bz2
Initialize first javascript rspec tests
Diffstat (limited to 'spec/features/lines_spec.rb')
-rw-r--r--spec/features/lines_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/features/lines_spec.rb b/spec/features/lines_spec.rb
index d0db27f10..104d45b99 100644
--- a/spec/features/lines_spec.rb
+++ b/spec/features/lines_spec.rb
@@ -7,6 +7,7 @@ describe "Lines", :type => :feature do
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) }
subject { lines.first }
describe "list" do
@@ -39,12 +40,25 @@ describe "Lines", :type => :feature do
click_link "Ajouter une ligne"
fill_in "line_name", :with => "Line 1"
fill_in "Numéro d'enregistrement", :with => "1"
- fill_in "Identifiant Neptune", :with => "test:Line:999"
+ fill_in "Identifiant Neptune", :with => "test:Line:999"
click_button("Créer ligne")
expect(page).to have_content("Line 1")
end
end
+ describe "new with group of line", :js => true do
+ it "creates line and return to show" do
+ visit new_referential_line_path(referential)
+ fill_in "line_name", :with => "Line 1"
+ fill_in "Numéro d'enregistrement", :with => "1"
+ fill_in "Identifiant Neptune", :with => "test:Line:999"
+ fill_in_token_input('line_group_of_line_tokens', :with => "#{group_of_line.name}")
+ find_button("Créer ligne").trigger("click")
+ expect(page).to have_text("Line 1")
+ expect(page).to have_text("#{group_of_line.name}")
+ end
+ end
+
describe "edit and return to show" do
it "edit line" do
visit referential_line_path(referential, subject)