Added conversion links for recommended prices.

The paragraphs were getting a bit verbose so we shortened the link
text as well. Added an additional test to make sure the link is
working here too.
This commit is contained in:
Lucy
2013-07-03 13:16:36 +01:00
parent 5c92bb04d3
commit e674a6572e
3 changed files with 7 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ module ApplicationHelper
pid = price_in_dollars(price)
currency = Growstuff::Application.config.currency
link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}"
return link_to "See exchange rates",
return link_to "(convert)",
link,
:target => "_blank"
end

View File

@@ -55,12 +55,12 @@
Pay what you want, starting at
=succeed "." do
=price_with_currency(p.min_price)
=succeed "." do
=forex_link(p.min_price)
- if p.recommended_price
Recommended price:
=succeed "." do
=price_with_currency(p.recommended_price)
=forex_link(p.recommended_price)
%div
- if can? :create, Order

View File

@@ -32,6 +32,11 @@ describe 'shop/index.html.haml', :type => "view" do
rendered.should contain '12.00 AUD'
end
it 'should contain an exchange rate link for recommended price' do
currency = Growstuff::Application.config.currency
assert_select("a[href=http://www.wolframalpha.com/input/?i=12.00+#{currency}]")
end
it 'displays the order form' do
assert_select "form", :count => 2
end