Sha256: ccb93a39e967efc7279352f9b5a8bf65a420df228e0a2618417b1db237b53dcb

Contents?: true

Size: 1.24 KB

Versions: 31

Compression:

Stored size: 1.24 KB

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

  test 'locale helper returns correct locale when defined on shop model' do
    assert_equal :sv, disco_app_shops(:widget_store_dev).locale
  end

  test 'locale helper returns correct en locale when no known locale defined' do
    assert_equal :en, disco_app_shops(:widget_store).locale
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release test/models/disco_app/shop_test.rb
disco_app-0.10.5 test/models/disco_app/shop_test.rb
disco_app-0.11.0 test/models/disco_app/shop_test.rb
disco_app-0.11.1 test/models/disco_app/shop_test.rb
disco_app-0.12.0 test/models/disco_app/shop_test.rb
disco_app-0.12.1 test/models/disco_app/shop_test.rb
disco_app-0.12.5 test/models/disco_app/shop_test.rb
disco_app-0.12.6 test/models/disco_app/shop_test.rb
disco_app-0.12.7 test/models/disco_app/shop_test.rb
disco_app-0.13.0 test/models/disco_app/shop_test.rb
disco_app-0.13.1 test/models/disco_app/shop_test.rb
disco_app-0.13.2 test/models/disco_app/shop_test.rb
disco_app-0.13.3 test/models/disco_app/shop_test.rb
disco_app-0.13.4 test/models/disco_app/shop_test.rb
disco_app-0.13.5 test/models/disco_app/shop_test.rb
disco_app-0.13.6 test/models/disco_app/shop_test.rb
disco_app-0.13.7 test/models/disco_app/shop_test.rb
disco_app-0.13.8 test/models/disco_app/shop_test.rb
disco_app-0.14.1 test/models/disco_app/shop_test.rb
disco_app-0.14.2 test/models/disco_app/shop_test.rb