Sha256: d2430a41b3abf20e2eddb05d686f059c29fc5632ccdcaf20adde3e8ce5555870
Contents?: true
Size: 854 Bytes
Versions: 7
Compression:
Stored size: 854 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
7 entries across 7 versions & 1 rubygems