Sha256: d200b6e0b25d8b6a152a1467afa48b1a1be28313a5f91d7d1d759da753378f7f

Contents?: true

Size: 831 Bytes

Versions: 21

Compression:

Stored size: 831 Bytes

Contents

class ShopCustomersDataset < Dataset::Base
  
  def load
    create_model :shop_customer, :customer,
      :name     => 'customer',
      :email    => 'customer@example.com',
      :login    => 'customer',
      :password => 'radiant',
      :password_confirmation => 'radiant'
      
    create_model :shop_customer, :bad_customer,
      :name     => 'bad customer',
      :email    => 'bad_customer@example.com',
      :login    => 'bad customer',
      :password => 'radiant',
      :password_confirmation => 'radiant'
  end
  
  helpers do
    def login_as(user)
      login_user = users(user)
      flunk "Can't login as non-existing user #{user.to_s}." unless login_user
      UserActionObserver.current_user = login_user
      login_user
    end

    def logout
      UserActionObserver.current_user = nil
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
radiant-shop-extension-0.94.8 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.7 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.6 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.5 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.4 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.3 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.2 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.1 spec/datasets/shop_customers.rb
radiant-shop-extension-0.94.0 spec/datasets/shop_customers.rb
radiant-shop-extension-0.93.3 spec/datasets/shop_customers.rb
radiant-shop-extension-0.93.2 spec/datasets/shop_customers.rb
radiant-shop-extension-0.93.1 spec/datasets/shop_customers.rb
radiant-shop-extension-0.93.0 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.11 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.10 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.9 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.8 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.7 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.6 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.3 spec/datasets/shop_customers.rb