Browse Source

Update some tests

CLDC-3740-Replace-you-didnt-answer-with-link
Manny Dinssa 2 months ago
parent
commit
c161f114e9
  1. 4
      spec/components/check_answers_summary_list_card_component_spec.rb
  2. 4
      spec/features/lettings_log_spec.rb
  3. 4
      spec/features/schemes_spec.rb
  4. 1
      spec/models/form/question_spec.rb
  5. 8
      spec/requests/check_errors_controller_spec.rb
  6. 2
      spec/requests/lettings_logs_controller_spec.rb
  7. 6
      spec/views/merge_requests/show.html.erb_spec.rb

4
spec/components/check_answers_summary_list_card_component_spec.rb

@ -46,7 +46,7 @@ RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do
let(:log) { create(:lettings_log, :in_progress) }
it "displays normal copy with muted colour " do
expect(rendered).to have_selector("span", class: "app-!-colour-muted", text: "You didn’t answer this question")
expect(rendered).to have_selector("span", class: "app-!-colour-muted", text: "No answer provided")
end
end
@ -56,7 +56,7 @@ RSpec.describe CheckAnswersSummaryListCardComponent, type: :component do
let(:log) { create(:lettings_log, :completed, creation_method: "bulk upload", tenancycode: nil, bulk_upload:) }
it "displays tweaked copy in red" do
expect(rendered).to have_selector("span", class: "app-!-colour-muted", text: "You didn’t answer this question")
expect(rendered).to have_selector("span", class: "app-!-colour-muted", text: "No answer provided")
expect(rendered).not_to have_selector("span", class: "app-!-colour-red", text: "You still need to answer this question")
end
end

4
spec/features/lettings_log_spec.rb

@ -353,7 +353,7 @@ RSpec.describe "Lettings Log Features" do
let!(:org_rel2) { create(:organisation_relationship, parent_organisation: support_user.organisation, child_organisation: managing_org2) }
context "and the organisation relationship for the selected managing agent is deleted" do
it "doesn't change the CYA page text to be 'You didn't answer this question'" do
it "doesn't change the CYA page text to be 'No answer provided'" do
visit("/lettings-logs")
click_button("Create a new lettings log")
click_link("Set up this lettings log")
@ -499,7 +499,7 @@ RSpec.describe "Lettings Log Features" do
let!(:org_rel2) { create(:organisation_relationship, child_organisation: user.organisation, parent_organisation: owning_org2) }
context "and the organisation relationship for the selected stock owner is deleted" do
it "doesn't change the CYA page text to be 'You didn't answer this question'" do
it "doesn't change the CYA page text to be 'No answer provided'" do
visit("/lettings-logs")
click_button("Create a new lettings log")
click_link("Set up this lettings log")

4
spec/features/schemes_spec.rb

@ -577,7 +577,7 @@ RSpec.describe "Schemes scheme Features" do
fill_in_and_save_location
location.update!(location_code: nil)
visit "/schemes/#{scheme.id}/locations/#{location.id}/check-answers"
expect(page).to have_content "You didn’t answer this question"
expect(page).to have_content "No answer provided"
end
end
@ -666,7 +666,7 @@ RSpec.describe "Schemes scheme Features" do
choose "Yes"
click_button "Save changes"
visit("/schemes/#{scheme.id}/check-answers")
expect(page).to have_content("You didn’t answer this question")
expect(page).to have_content("No answer provided")
end
end

1
spec/models/form/question_spec.rb

@ -281,7 +281,6 @@ RSpec.describe Form::Question, type: :model do
end
it "has an update answer link text helper" do
expect(question.action_text(lettings_log)).to match(/Answer/)
lettings_log["incfreq"] = 0
expect(question.action_text(lettings_log)).to match(/Change/)
end

8
spec/requests/check_errors_controller_spec.rb

@ -294,7 +294,7 @@ RSpec.describe CheckErrorsController, type: :request do
it "displays correct clear links" do
expect(page).to have_content("Make sure these answers are correct")
expect(page).to have_content("You didn’t answer this question")
expect(page).to have_content("No answer provided")
expect(page).to have_link("Answer")
expect(lettings_log.reload.earnings).to eq(nil)
end
@ -349,7 +349,7 @@ RSpec.describe CheckErrorsController, type: :request do
it "displays correct clear links" do
expect(page).to have_content("Make sure these answers are correct")
expect(page).to have_content("You didn’t answer this question")
expect(page).to have_content("No answer provided")
expect(page).to have_link("Answer")
expect(sales_log.reload.income1).to eq(nil)
end
@ -440,7 +440,7 @@ RSpec.describe CheckErrorsController, type: :request do
it "correctly clears the values" do
expect(page).to have_content("Make sure these answers are correct")
expect(page).to have_content("You didn’t answer this question")
expect(page).to have_content("No answer provided")
expect(page.all(:button, value: "Clear").count).to eq(0)
expect(lettings_log.reload.earnings).to eq(nil)
expect(lettings_log.reload.incfreq).to eq(nil)
@ -470,7 +470,7 @@ RSpec.describe CheckErrorsController, type: :request do
it "displays correct clear links" do
expect(page).to have_content("Make sure these answers are correct")
expect(page).to have_content("You didn’t answer this question")
expect(page).to have_content("No answer provided")
expect(page.all(:button, value: "Clear").count).to eq(0)
expect(sales_log.reload.income1).to eq(nil)
expect(sales_log.reload.la).to eq(nil)

2
spec/requests/lettings_logs_controller_spec.rb

@ -1300,7 +1300,7 @@ RSpec.describe LettingsLogsController, type: :request do
it "shows `you haven't answered this question` if the question wasn’t answered" do
get "/lettings-logs/#{id}/income-and-benefits/check-answers"
expect(CGI.unescape_html(response.body)).to include("You didn’t answer this question")
expect(CGI.unescape_html(response.body)).to include("No answer provided")
end
it "does not allow you to change the answers for previous collection year logs" do

6
spec/views/merge_requests/show.html.erb_spec.rb

@ -24,7 +24,7 @@ RSpec.describe "merge_requests/show.html.erb", type: :view do
it "displays the requester details" do
expect(rendered).to have_selector("dt", text: "Requester")
expect(rendered).to have_selector("dd", text: merge_request.requester&.name || "You didn't answer this question")
expect(rendered).to have_selector("dd", text: merge_request.requester&.name || "No answer provided")
end
it "displays the helpdesk ticket details" do
@ -32,7 +32,7 @@ RSpec.describe "merge_requests/show.html.erb", type: :view do
if merge_request.helpdesk_ticket.present?
expect(rendered).to have_link(merge_request.helpdesk_ticket, href: "https://mhclgdigital.atlassian.net/browse/#{merge_request.helpdesk_ticket}")
else
expect(rendered).to have_selector("dd", text: "You didn't answer this question")
expect(rendered).to have_selector("dd", text: "No answer provided")
end
end
@ -48,7 +48,7 @@ RSpec.describe "merge_requests/show.html.erb", type: :view do
it "displays the merge date details" do
expect(rendered).to have_selector("dt", text: "Merge date")
expect(rendered).to have_selector("dd", text: merge_request.merge_date || "You didn't answer this question")
expect(rendered).to have_selector("dd", text: merge_request.merge_date || "No answer provided")
end
context "when the merge request is complete" do

Loading…
Cancel
Save