Sha256: 493b58b487705744b5aaa759bafa8f4f13c8f16e987365096f29b5deaf7b13de

Contents?: true

Size: 599 Bytes

Versions: 3

Compression:

Stored size: 599 Bytes

Contents

require 'test_helper'

class TaskTest < ActiveSupport::TestCase
  include RateHelper

  setup do
    Dummy::Application.load_tasks
  end

  test 'update rates' do
    response = mock_response(:yahoo, '200', :multiple)
    Net::HTTP.stubs(:get_response).returns response
    silence_stream(STDOUT) do
      Rake::Task['economy:update_rates'].invoke
    end

    assert_equal 2, Economy::Exchange.count
    assert Economy::Exchange.exists?(service: 'Yahoo', from: 'USD', to: 'UYU', rate: 29.3200)
    assert Economy::Exchange.exists?(service: 'Yahoo', from: 'UYU', to: 'USD', rate: 0.0341)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
economy-4.0.2.2 test/task_test.rb
economy-4.0.2.1 test/task_test.rb
economy-4.0.2.0 test/task_test.rb