Browse Source

Fix the tests and add files to .gitignore

pull/49/head
Kat 4 years ago
parent
commit
7b07934e8d
  1. 3
      .gitignore
  2. 8
      spec/features/case_log_spec.rb
  3. 4
      spec/helpers/tasklist_helper_spec.rb
  4. 2
      spec/models/form_handler_spec.rb

3
.gitignore vendored

@ -43,3 +43,6 @@ yarn-debug.log*
#IDE specific files #IDE specific files
/.idea /.idea
/.idea/* /.idea/*
.DS_Store
.generators
.rakeTasks

8
spec/features/case_log_spec.rb

@ -49,7 +49,7 @@ RSpec.describe "Test Features" do
it "displays a section status" do it "displays a section status" do
visit("/case_logs/#{empty_case_log.id}") visit("/case_logs/#{empty_case_log.id}")
assert_selector ".govuk-tag", text: /Not started/, count: 7 assert_selector ".govuk-tag", text: /Not started/, count: 8
assert_selector ".govuk-tag", text: /Completed/, count: 0 assert_selector ".govuk-tag", text: /Completed/, count: 0
assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1 assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1
end end
@ -58,7 +58,7 @@ RSpec.describe "Test Features" do
answer_all_questions_in_income_subsection answer_all_questions_in_income_subsection
visit("/case_logs/#{empty_case_log.id}") visit("/case_logs/#{empty_case_log.id}")
assert_selector ".govuk-tag", text: /Not started/, count: 6 assert_selector ".govuk-tag", text: /Not started/, count: 7
assert_selector ".govuk-tag", text: /Completed/, count: 1 assert_selector ".govuk-tag", text: /Completed/, count: 1
assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1 assert_selector ".govuk-tag", text: /Cannot start yet/, count: 1
end end
@ -70,13 +70,13 @@ RSpec.describe "Test Features" do
it "shows the number of completed sections if no sections are completed" do it "shows the number of completed sections if no sections are completed" do
visit("/case_logs/#{empty_case_log.id}") visit("/case_logs/#{empty_case_log.id}")
expect(page).to have_content("You've completed 0 of 8 sections.") expect(page).to have_content("You've completed 0 of 9 sections.")
end end
it "shows the number of completed sections if one section is completed" do it "shows the number of completed sections if one section is completed" do
answer_all_questions_in_income_subsection answer_all_questions_in_income_subsection
visit("/case_logs/#{empty_case_log.id}") visit("/case_logs/#{empty_case_log.id}")
expect(page).to have_content("You've completed 1 of 8 sections.") expect(page).to have_content("You've completed 1 of 9 sections.")
end end
end end

4
spec/helpers/tasklist_helper_spec.rb

@ -54,7 +54,7 @@ RSpec.describe TasklistHelper do
describe "get sections count" do describe "get sections count" do
it "returns the total of sections if no status is given" do it "returns the total of sections if no status is given" do
expect(get_subsections_count(form, empty_case_log)).to eq(8) expect(get_subsections_count(form, empty_case_log)).to eq(9)
end end
it "returns 0 sections for completed sections if no sections are completed" do it "returns 0 sections for completed sections if no sections are completed" do
@ -62,7 +62,7 @@ RSpec.describe TasklistHelper do
end end
it "returns the number of not started sections" do it "returns the number of not started sections" do
expect(get_subsections_count(form, empty_case_log, :not_started)).to eq(7) expect(get_subsections_count(form, empty_case_log, :not_started)).to eq(8)
end end
it "returns the number of sections in progress" do it "returns the number of sections in progress" do

2
spec/models/form_handler_spec.rb

@ -15,7 +15,7 @@ RSpec.describe FormHandler do
form_handler = FormHandler.instance form_handler = FormHandler.instance
form = form_handler.get_form("test_form") form = form_handler.get_form("test_form")
expect(form).to be_a(Form) expect(form).to be_a(Form)
expect(form.all_pages.count).to eq(18) expect(form.all_pages.count).to eq(21)
end end
end end

Loading…
Cancel
Save