From 5c92bb04d32613dc58d0e316a14ea2a2eabb1527 Mon Sep 17 00:00:00 2001 From: Lucy Date: Wed, 3 Jul 2013 13:04:43 +0100 Subject: [PATCH] Updated the foreign exchange link to use configured currency. --- app/helpers/application_helper.rb | 3 ++- spec/views/shop/index_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a2e14987b..fcd8e1cdc 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -17,7 +17,8 @@ module ApplicationHelper def forex_link(price) pid = price_in_dollars(price) - link = "http://www.wolframalpha.com/input/?i=#{pid}+aud" + currency = Growstuff::Application.config.currency + link = "http://www.wolframalpha.com/input/?i=#{pid}+#{currency}" return link_to "See exchange rates", link, :target => "_blank" diff --git a/spec/views/shop/index_spec.rb b/spec/views/shop/index_spec.rb index 67dcdb081..ced2fee99 100644 --- a/spec/views/shop/index_spec.rb +++ b/spec/views/shop/index_spec.rb @@ -24,7 +24,8 @@ describe 'shop/index.html.haml', :type => "view" do end it 'should contain an exchange rate link' do - assert_select("a[href=http://www.wolframalpha.com/input/?i=9.99+aud]") + currency = Growstuff::Application.config.currency + assert_select("a[href=http://www.wolframalpha.com/input/?i=9.99+#{currency}]") end it 'shows recommended price for products that have it' do