Sha256: b4aac3afb396933e320a4ee1a531f6d92c1ccf36caeb7eafe89805b6fe97cd24

Contents?: true

Size: 971 Bytes

Versions: 5

Compression:

Stored size: 971 Bytes

Contents

require 'test_helper'

class DiscoApp::ShopTest < ActiveSupport::TestCase

  def setup
    @shop = disco_app_shops(:widget_store)
  end

  def teardown
    @shop = nil
  end

  test 'shops can be extended via concerns' do
    assert_equal 'Australia', @shop.country.name
  end

  test 'can fetch a list of all of a shops subscriptions' do
    assert_equal 2, @shop.subscriptions.size
  end

  test 'can fetch a shops current subscription' do
    assert_equal 1, @shop.subscriptions.active.size
    assert @shop.current_subscription?
    assert_equal disco_app_subscriptions(:current_widget_store_subscription), @shop.current_subscription
  end

  test 'time_zone helper returns correct time zone instance when known timezone defined' do
    assert_equal 'Melbourne', @shop.time_zone.name
  end

  test 'time_zone helper returns default Rails timezone when no known timezone defined' do
    assert_equal 'UTC', disco_app_shops(:widget_store_dev).time_zone.name
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
disco_app-0.10.0 test/models/disco_app/shop_test.rb
disco_app-0.10.1 test/models/disco_app/shop_test.rb
disco_app-0.10.2 test/models/disco_app/shop_test.rb
disco_app-0.10.3 test/models/disco_app/shop_test.rb
disco_app-0.10.4 test/models/disco_app/shop_test.rb