Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/admin/suppliers/_show_frameworks.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%td.govuk-table__cell
- if agreement.active?
= link_to 'Deactivate', admin_supplier_agreement_confirm_deactivation_path(@supplier, agreement)
- else
- if !agreement.active? && !framework.archived?
= link_to 'Activate', admin_supplier_agreement_confirm_activation_path(@supplier, agreement)
%nav.pagination.ccs-pagination{"aria-label" => "Pagination", :role => "navigation"}
#framework_pagination_summary.ccs-pagination__summary= page_entries_info @agreements, entry_name: "agreement"
Expand Down
13 changes: 11 additions & 2 deletions spec/features/view_supplier_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
RSpec.feature 'Viewing a supplier' do
let!(:supplier) { FactoryBot.create(:supplier, name: 'Test Supplier Ltd') }
let!(:framework) { FactoryBot.create(:framework, name: 'Test Framework', short_name: 'RM0000') }
let!(:archived_framework) { FactoryBot.create(:framework, name: 'Archived Framework', short_name: 'RM0001') }
let!(:agreement) { FactoryBot.create(:agreement, supplier: supplier, framework: framework) }
let!(:inactive_agreement) { FactoryBot.create(:agreement, supplier: supplier, framework: archived_framework) }
let!(:user) { FactoryBot.create(:user, name: 'User One', email: 'email_one@ccs.co.uk', suppliers: [supplier]) }

before { sign_in_as_admin }
Expand All @@ -12,7 +14,14 @@
visit admin_supplier_path(supplier)
expect(page).to have_content 'Test Supplier Ltd'
expect(page).to have_content 'RM0000 Test Framework'
expect(page).to have_content 'Displaying 1 agreement'
expect(page).to have_content 'Displaying all 2 agreements'
end

scenario 'shows activate/deactivate links based on agreement and framework status' do
visit admin_supplier_path(supplier)
expect(page).to have_link 'Deactivate',
href: admin_supplier_agreement_confirm_deactivation_path(supplier, agreement)
expect(page).not_to have_link 'Activate'
end

scenario 'shows paginated list of the supplier’s tasks' do
Expand Down Expand Up @@ -73,6 +82,6 @@
click_link('Next »', match: :first)
expect(page).to have_content 'Displaying task 13 - 13 of 13 in total'
expect(page).to have_content 'Displaying users 1 - 12 of 13 in total'
expect(page).to have_content 'Displaying 1 agreement'
expect(page).to have_content 'Displaying all 2 agreements'
end
end
Loading