Permalink
Browse files

Update all tests with new content and to be passing

  • Loading branch information...
1 parent d1bc852 commit 826d84dc34996c9dfe29ba2918d2ec194d348135 @jackfranklin jackfranklin committed Mar 21, 2013
@@ -3,7 +3,11 @@
<% @transaction.document_types.each do |value,label| %>
<li>
<%= label_tag "transaction_document_type_#{value}" do %>
- <%= radio_button_tag "transaction[document_type]", value %> <%= label %>
+ <%
+ formatted_label = label
+ formatted_label[0] = formatted_label[0].capitalize
+ %>
+ <%= radio_button_tag "transaction[document_type]", value %> <%= formatted_label %>
<% end %>
</li>
<% end %>
@@ -1 +1 @@
-<p>The cost to deposit <%= pluralize @calculation.document_count, "certificate" %><% if @calculation.postage %> plus postage <% end %> is &pound;<%= format_money @calculation.total_cost %>.
+<p>The cost to deposit <%= pluralize @calculation.document_count, "certificate" %><% if @calculation.postage %> plus postage<% end %> is &pound;<%= format_money @calculation.total_cost %>.
@@ -1 +1 @@
-<p>It costs &pound;<%= @calculation.total_cost %> for <%= pluralize @calculation.document_count, "document" %> plus <%= @calculation.postage_option_label %> postage.</p>
+<p>It costs &pound;<%= @calculation.total_cost %> for <%= pluralize @calculation.document_count, "document" %><% if @calculation.postage_option_label != "" %> plus <%= @calculation.postage_option_label %> postage<% end %>.</p>
@@ -1 +1 @@
-<p>The cost for <%= pluralize @calculation.registration_count, "registration" %> and <%= pluralize @calculation.document_count, "certificate" %><% if @calculation.postage? %> plus postage<% end %> is &pound;<%= format_money @calculation.total_cost %>.</p>
+<p>The cost for <%= pluralize @calculation.registration_count, "registration" %> and <%= pluralize @calculation.document_count, "certificate" %><% if @calculation.postage %> plus postage<% end %> is &pound;<%= format_money @calculation.total_cost %>.</p>
@@ -65,7 +65,7 @@ def pluralize_document_type_label(quantity, label)
case label
when /\Acertificate/i then label.sub(/\A([cC])ertificate/i, '\1ertificates')
- when "Nulla osta" then "Nulla Ostas" # pluralize thinks this is already plural
+ when "Nulla Osta" then "Nulla Ostas" # pluralize thinks this is already plural
else
label.pluralize(quantity)
end
@@ -76,7 +76,7 @@
it "should calculate the correct total cost" do
assigns(:calculation).total_cost.should == 335
- assigns(:calculation).item_list.should == "5 Nulla ostas, plus postage,"
+ assigns(:calculation).item_list.should == "5 Nulla Ostas plus postage"
end
it "is successful" do
@@ -147,7 +147,7 @@
it "should calculate the correct total cost" do
assigns(:calculation).total_cost.should == 860
- assigns(:calculation).item_list.should == "5 birth registrations and 5 birth certificates, plus postage,"
+ assigns(:calculation).item_list.should == "5 birth registrations and 5 birth certificates plus postage"
end
it "is successful" do
@@ -23,7 +23,7 @@
within(:css, "form") do
page.should have_content("Pay for documents you need from the Foreign & Commonwealth Office (FCO) to prove you’re allowed to get married abroad.")
page.should have_unchecked_field("Certificate of no impediment")
- page.should have_unchecked_field("Nulla osta")
+ page.should have_unchecked_field("Nulla Osta")
page.should have_unchecked_field("Certificate of custom law")
page.should have_content("Each certificate costs £65.")
@@ -50,7 +50,7 @@
end
it "calculates a total" do
- page.should have_content("The cost for 3 Certificates of custom law, plus postage, is £205")
+ page.should have_content("The cost of 3 Certificates of custom law plus postage is £205")
end
it "generates an EPDQ form" do
@@ -172,7 +172,7 @@
end
it "calculates a total" do
- page.should have_content("The cost for 2 birth registrations and 3 birth certificates, plus postage, is £415")
+ page.should have_content("The cost for 2 registrations and 3 certificates is £415")
end
it "generates an EPDQ form" do
@@ -232,7 +232,7 @@
end
it "calculates a total" do
- page.should have_content("The cost for 5 death registrations and 1 death certificate, plus postage, is £600")
+ page.should have_content("The cost for 5 registrations and 1 certificate plus postage is £600")
end
it "generates an EPDQ form" do
@@ -288,7 +288,7 @@
end
it "calculates a total" do
- page.should have_content("The cost for 1 document, plus postage, is £45")
+ page.should have_content("The cost to deposit 1 certificate plus postage is £45")
end
it "generates an EPDQ form" do
@@ -348,7 +348,7 @@
end
it "calculates a total" do
- page.should have_content("The cost for 1 document, plus Rest of the World postage, is £55")
+ page.should have_content("It costs £55 for 1 document plus Rest of the World postage")
end
it "generates an EPDQ form" do
@@ -417,7 +417,7 @@
end
it "calculates a total" do
- page.should have_content("The cost for 5 documents is £375.")
+ page.should have_content("It costs £375 for 5 documents")
end
it "generates an EPDQ form" do
@@ -32,7 +32,7 @@
end
it "builds an item list with postage" do
- @calculator.calculate(:document_count => 5, :postage => "yes").item_list.should == "5 documents, plus postage,"
+ @calculator.calculate(:document_count => 5, :postage => "yes").item_list.should == "5 documents plus postage"
end
end
@@ -62,7 +62,7 @@
end
it "builds an item list for multiple documents, plus postage" do
- @calculator.calculate(:document_count => 2, :document_type => "tea-assurance-document", :postage => "yes").item_list.should == "2 Tea assurance documents, plus postage,"
+ @calculator.calculate(:document_count => 2, :document_type => "tea-assurance-document", :postage => "yes").item_list.should == "2 Tea assurance documents plus postage"
end
it "builds an item list for a single certificate" do
@@ -110,7 +110,7 @@
end
it "builds an item list for multiple registrations and documents, with postage" do
- @calculator.calculate(:registration_count => 1, :document_count => 4, :postage => "yes").item_list.should == "1 tea registration and 4 tea certificates, plus postage,"
+ @calculator.calculate(:registration_count => 1, :document_count => 4, :postage => "yes").item_list.should == "1 tea registration and 4 tea certificates plus postage"
end
end
@@ -144,11 +144,11 @@
end
it "builds an item list including the postage type" do
- @calculator.calculate(:postage_option => "horse-and-cart").item_list.should == "0 documents, plus Horse and cart postage,"
+ @calculator.calculate(:postage_option => "horse-and-cart").item_list.should == "0 documents plus Horse and cart postage"
end
it "builds an item list of multiple documents including the postage type" do
- @calculator.calculate(:postage_option => "flying-machine", :document_count => 3).item_list.should == "3 documents, plus Flying machine postage,"
+ @calculator.calculate(:postage_option => "flying-machine", :document_count => 3).item_list.should == "3 documents plus Flying machine postage"
end
it "raises an error if no postage option set" do

0 comments on commit 826d84d

Please sign in to comment.