aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/referentials_spec.rb
diff options
context:
space:
mode:
authorZog2018-02-08 10:33:46 +0100
committerLuc Donnet2018-02-20 10:20:18 +0100
commit3dcea81c627c1c740630ce7306bac55256ce8037 (patch)
tree1ff79bdb5f04aba4503b47c781aaa0146d1ac32a /spec/features/referentials_spec.rb
parent3809301116aec5466445b29637026804da3d6745 (diff)
downloadchouette-core-3dcea81c627c1c740630ce7306bac55256ce8037.tar.bz2
Refs #5863 @6h; Remove workbench id from the querystring
Infer it when possible, and use a nested otherwise
Diffstat (limited to 'spec/features/referentials_spec.rb')
-rw-r--r--spec/features/referentials_spec.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/features/referentials_spec.rb b/spec/features/referentials_spec.rb
index 9af0ed32e..d4890fda4 100644
--- a/spec/features/referentials_spec.rb
+++ b/spec/features/referentials_spec.rb
@@ -55,7 +55,7 @@ describe "Referentials", :type => :feature do
context 'user has the permission to create referentials' do
it 'shows the clone link for referetnial' do
- expect(page).to have_link(I18n.t('actions.clone'), href: new_referential_path(from: referential.id))
+ expect(page).to have_link(I18n.t('actions.clone'), href: new_workbench_referential_path(referential.workbench, from: referential.id))
end
end
@@ -63,7 +63,7 @@ describe "Referentials", :type => :feature do
it 'does not show the clone link for referetnial' do
@user.update_attribute(:permissions, [])
visit referential_path(referential)
- expect(page).not_to have_link(I18n.t('actions.clone'), href: new_referential_path(from: referential.id))
+ expect(page).not_to have_link(I18n.t('actions.clone'), href: new_workbench_referential_path(referential.workbench, from: referential.id))
end
end
@@ -108,8 +108,9 @@ describe "Referentials", :type => :feature do
end
describe "create" do
+ let(:workbench){ @user.organisation.workbenches.last }
it "should" do
- visit new_referential_path
+ visit new_workbench_referential_path(workbench)
fill_in "Nom", :with => "Test"
click_button "Valider"
@@ -132,7 +133,7 @@ describe "Referentials", :type => :feature do
context "when user is from the same organisation" do
xit "should" do
- visit new_referential_path(from: referential.id, current_workbench_id: @user.organisation.workbenches.first.id)
+ visit new_workbench_referential_path(referential.workbench, from: referential.id, current_workbench_id: @user.organisation.workbenches.first.id)
select "2018", :from => "referential_metadatas_attributes_0_periods_attributes_0_begin_1i"
@@ -187,7 +188,8 @@ describe "Referentials", :type => :feature do
end
describe "destroy" do
- let(:referential) { create(:referential, :organisation => @user.organisation) }
+ let(:workbench){ @user.organisation.workbenches.last }
+ let(:referential) { create(:referential, :organisation => @user.organisation, workbench: workbench) }
it "should remove referential" do
visit referential_path(referential)