aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-12-21 18:07:24 +0100
committerTeddy Wing2017-12-21 18:15:47 +0100
commit174d002f2a14df9e2dfd317271882668fa2a90bb (patch)
tree6cf2dc7a724ccfd2d74efe82fbd21475c532ce4d
parent10d2e7cdf08de08f96e4978595dc33ab26f9d50d (diff)
downloadchouette-core-174d002f2a14df9e2dfd317271882668fa2a90bb.tar.bz2
purchase_windows_spec: Add feature test for PurchaseWindow update
Test that `PurchaseWindow`s can be updated starting from the `#index` page. Refs #5366
-rw-r--r--spec/features/purchase_windows_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/features/purchase_windows_spec.rb b/spec/features/purchase_windows_spec.rb
index c30be48a3..0fa576434 100644
--- a/spec/features/purchase_windows_spec.rb
+++ b/spec/features/purchase_windows_spec.rb
@@ -19,5 +19,28 @@ describe "PurchaseWindows", type: :feature do
expect(page).to have_content(name)
end
end
+
+ with_permissions('purchase_windows.update') do
+ it "allows users to update purchase windows" do
+ actual_name = 'Existing purchase window'
+ expected_name = 'Updated purchase window'
+ create(
+ :purchase_window,
+ referential: first_referential,
+ name: actual_name
+ )
+
+ visit(referential_purchase_windows_path(first_referential.id))
+
+ click_link(actual_name)
+
+ click_link(I18n.t('purchase_windows.actions.edit'))
+ fill_in('purchase_window[name]', with: expected_name)
+
+ click_button(I18n.t('actions.submit'))
+
+ expect(page).to have_content(expected_name)
+ end
+ end
end
end