Browse Source

make tasklist feature spec test a request spec

pull/121/head
MadeTech Dushan 3 years ago
parent
commit
27b9ca800d
  1. 8
      spec/features/form/tasklist_page_spec.rb
  2. 6
      spec/requests/case_log_controller_spec.rb

8
spec/features/form/tasklist_page_spec.rb

@ -26,14 +26,6 @@ RSpec.describe "Task List" do
sign_in user
end
it "displays a section status" do
visit("/case_logs/#{empty_case_log.id}")
assert_selector ".govuk-tag", text: /Not started/, count: 8
assert_selector ".govuk-tag", text: /Completed/, count: 0
assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1
end
it "shows the correct status if one section is completed" do
answer_all_questions_in_income_subsection(empty_case_log)
visit("/case_logs/#{empty_case_log.id}")

6
spec/requests/case_log_controller_spec.rb

@ -190,6 +190,12 @@ RSpec.describe CaseLogsController, type: :request do
expect(response.body).to match("Tasklist for log")
expect(response.body).to match(case_log.id.to_s)
end
it "displays a section status for a case log" do
assert_select ".govuk-tag", text: /Not started/, count: 8
assert_select ".govuk-tag", text: /Completed/, count: 0
assert_select ".govuk-tag", text: /Cannot start yet/, count: 1
end
end
context "case logs that are not owned or managed by your organisation" do

Loading…
Cancel
Save