Sha256: 10926b8fab27a6beaddb1993f642acb3a20da21bf116c23892f280160ce18d70

Contents?: true

Size: 600 Bytes

Versions: 3

Compression:

Stored size: 600 Bytes

Contents

require 'test_helper'

class TaskTest < ActiveSupport::TestCase
  include RatesHelper

  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.1.0 test/task_test.rb
economy-4.0.0.0 test/task_test.rb
economy-0.0.1 test/task_test.rb