Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antoni-devlin committed Apr 25, 2024
1 parent e33b51b commit b5be9e1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
24 changes: 12 additions & 12 deletions test/flows/next_steps_for_your_business_flow_test.rb
Expand Up @@ -10,8 +10,8 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
assert_rendered_start_page
end

context "question: annual_turnover_over_85k" do
setup { testing_node :annual_turnover_over_85k }
context "question: annual_turnover_over_90k" do
setup { testing_node :annual_turnover_over_90k }

should "render the question" do
assert_rendered_question
Expand All @@ -27,7 +27,7 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
context "question: employ_someone" do
setup do
testing_node :employ_someone
add_responses annual_turnover_over_85k: "yes"
add_responses annual_turnover_over_90k: "yes"
end

should "render the question" do
Expand All @@ -44,7 +44,7 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
context "question: activities" do
setup do
testing_node :activities
add_responses annual_turnover_over_85k: "yes",
add_responses annual_turnover_over_90k: "yes",
employ_someone: "yes"
end

Expand All @@ -62,7 +62,7 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
context "question: financial_support" do
setup do
testing_node :financial_support
add_responses annual_turnover_over_85k: "yes",
add_responses annual_turnover_over_90k: "yes",
employ_someone: "yes",
activities: "import_goods"
end
Expand All @@ -81,7 +81,7 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
context "question: business_premises" do
setup do
testing_node :business_premises
add_responses annual_turnover_over_85k: "yes",
add_responses annual_turnover_over_90k: "yes",
employ_someone: "yes",
activities: "import_goods",
financial_support: "yes"
Expand All @@ -101,7 +101,7 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
context "outcome: results" do
setup do
testing_node :results
add_responses annual_turnover_over_85k: "no",
add_responses annual_turnover_over_90k: "no",
employ_someone: "no",
activities: "none",
financial_support: "no",
Expand Down Expand Up @@ -164,19 +164,19 @@ class NextStepsForYourBusinessFlowTest < ActiveSupport::TestCase
assert_rendered_outcome text: "Learn how to deal with personal information"
end

should "render VAT results if business has annual turnover more than 85k" do
add_responses annual_turnover_over_85k: "yes"
should "render VAT results if business has annual turnover more than 90k" do
add_responses annual_turnover_over_90k: "yes"
assert_rendered_outcome text: "Register for VAT"
assert_rendered_outcome text: "How and when to charge VAT"
end

should "render VAT result if business is unsure of annual turnover" do
add_responses annual_turnover_over_85k: "not_sure"
add_responses annual_turnover_over_90k: "not_sure"
assert_rendered_outcome text: "Check if you'll need to register for VAT"
end

should "render VAT result if business annual turnover is less than 85k" do
add_responses annual_turnover_over_85k: "no"
should "render VAT result if business annual turnover is less than 90k" do
add_responses annual_turnover_over_90k: "no"
assert_rendered_outcome text: "You can register for VAT if you want to"
end

Expand Down
Expand Up @@ -29,35 +29,35 @@ class NextStepsForYourBusinessCalculatorTest < ActiveSupport::TestCase
end

context "r16" do
should "return true when annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "yes"
should "return true when annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "yes"
assert @rules[:r16].call(@calculator)
end

should "return false when annual turnover is not over 85k" do
@calculator.annual_turnover_over_85k = "no"
should "return false when annual turnover is not over 90k" do
@calculator.annual_turnover_over_90k = "no"
assert_not @rules[:r16].call(@calculator)
end

should "return false when unsure if annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "not_sure"
should "return false when unsure if annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "not_sure"
assert_not @rules[:r16].call(@calculator)
end
end

context "r17" do
should "return false when annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "yes"
should "return false when annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "yes"
assert_not @rules[:r17].call(@calculator)
end

should "return false when annual turnover is not over 85k" do
@calculator.annual_turnover_over_85k = "no"
should "return false when annual turnover is not over 90k" do
@calculator.annual_turnover_over_90k = "no"
assert_not @rules[:r17].call(@calculator)
end

should "return true when unsure if annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "not_sure"
should "return true when unsure if annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "not_sure"
assert @rules[:r17].call(@calculator)
end
end
Expand Down Expand Up @@ -223,35 +223,35 @@ class NextStepsForYourBusinessCalculatorTest < ActiveSupport::TestCase
end

context "r28" do
should "return true when annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "yes"
should "return true when annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "yes"
assert @rules[:r28].call(@calculator)
end

should "return false when annual turnover is not over 85k" do
@calculator.annual_turnover_over_85k = "no"
should "return false when annual turnover is not over 90k" do
@calculator.annual_turnover_over_90k = "no"
assert_not @rules[:r28].call(@calculator)
end

should "return false when unsure if annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "not_sure"
should "return false when unsure if annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "not_sure"
assert_not @rules[:r28].call(@calculator)
end
end

context "r29" do
should "return false when annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "yes"
should "return false when annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "yes"
assert_not @rules[:r29].call(@calculator)
end

should "return true when annual turnover is not over 85k" do
@calculator.annual_turnover_over_85k = "no"
should "return true when annual turnover is not over 90k" do
@calculator.annual_turnover_over_90k = "no"
assert @rules[:r29].call(@calculator)
end

should "return false when unsure if annual turnover is over 85k" do
@calculator.annual_turnover_over_85k = "not_sure"
should "return false when unsure if annual turnover is over 90k" do
@calculator.annual_turnover_over_90k = "not_sure"
assert_not @rules[:r29].call(@calculator)
end
end
Expand Down

0 comments on commit b5be9e1

Please sign in to comment.