Sha256: b659147e8c0e953f55b561217bfd1c985bce08dff2b4e626997d33bd66409760

Contents?: true

Size: 828 Bytes

Versions: 59

Compression:

Stored size: 828 Bytes

Contents

require 'test_helper'

class DiscoApp::SessionTest < ActiveSupport::TestCase

  def setup
    @shop = disco_app_shops(:widget_store)
    @session = DiscoApp::Session.create(
      session_id: 'a91bfc51fa79c9d09d43e2615d9345d4',
      data: {
        :shopify => @shop.id,
        :shopify_domain => @shop.shopify_domain
      }
    )
  end

  test 'logged in sessions are linked to their shop' do
    assert_equal @shop.id, @session.shop_id
  end

  test 'can fetch sessions for a particular shop through association' do
    assert_equal 1, @shop.sessions.size
  end

  test 'sessions can be deleted by shop' do
    DiscoApp::Session.create(session_id: 'a91bfc51fa79c9d09d43e2615d9345d5', data: {})
    assert_equal 2, DiscoApp::Session.count
    @shop.sessions.delete_all
    assert_equal 1, DiscoApp::Session.count
  end

end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
disco_app-0.16.1.pre.sidekiq.pre.6.pre.release test/models/disco_app/session_test.rb
disco_app-0.7.0 test/models/disco_app/session_test.rb
disco_app-0.7.1 test/models/disco_app/session_test.rb
disco_app-0.7.2 test/models/disco_app/session_test.rb
disco_app-0.8.0 test/models/disco_app/session_test.rb
disco_app-0.8.1 test/models/disco_app/session_test.rb
disco_app-0.8.2 test/models/disco_app/session_test.rb
disco_app-0.8.3 test/models/disco_app/session_test.rb
disco_app-0.8.4 test/models/disco_app/session_test.rb
disco_app-0.8.5 test/models/disco_app/session_test.rb
disco_app-0.8.6 test/models/disco_app/session_test.rb
disco_app-0.8.7 test/models/disco_app/session_test.rb
disco_app-0.8.8 test/models/disco_app/session_test.rb
disco_app-0.8.9 test/models/disco_app/session_test.rb
disco_app-0.9.0 test/models/disco_app/session_test.rb
disco_app-0.9.1 test/models/disco_app/session_test.rb
disco_app-0.9.2 test/models/disco_app/session_test.rb
disco_app-0.9.3 test/models/disco_app/session_test.rb
disco_app-0.9.4 test/models/disco_app/session_test.rb
disco_app-0.9.5 test/models/disco_app/session_test.rb