mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-03-24 09:43:24 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user