Sha256: ce79aad03978676ef126ddfc1127dbd98f138d0c6318f27972095527096d2fcb

Contents?: true

Size: 857 Bytes

Versions: 10

Compression:

Stored size: 857 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 = user.is_a?(User) ? 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

10 entries across 10 versions & 1 rubygems

Version Path
radiant-shop-extension-0.92.1 spec/datasets/shop_customers.rb
radiant-shop-extension-0.92.0 spec/datasets/shop_customers.rb
radiant-shop-extension-0.91.7 spec/datasets/shop_customers.rb
radiant-shop-extension-0.91.4 spec/datasets/shop_customers.rb
radiant-shop-extension-0.91.3 spec/datasets/shop_customers.rb
radiant-shop-extension-0.91.2 spec/datasets/shop_customers.rb
radiant-shop-extension-0.90.4 spec/datasets/shop_customers.rb
radiant-shop-extension-0.90.2 spec/datasets/shop_customers.rb
radiant-shop-extension-0.90.1 spec/datasets/shop_customers.rb
radiant-shop-extension-0.90.0 spec/datasets/shop_customers.rb