diff options
| author | Teddy Wing | 2017-12-21 18:07:24 +0100 | 
|---|---|---|
| committer | Teddy Wing | 2017-12-21 18:15:47 +0100 | 
| commit | 174d002f2a14df9e2dfd317271882668fa2a90bb (patch) | |
| tree | 6cf2dc7a724ccfd2d74efe82fbd21475c532ce4d /spec/features | |
| parent | 10d2e7cdf08de08f96e4978595dc33ab26f9d50d (diff) | |
| download | chouette-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
Diffstat (limited to 'spec/features')
| -rw-r--r-- | spec/features/purchase_windows_spec.rb | 23 | 
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 | 
