mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-31 21:21:49 +01:00
update user scenario to work with sqlite3
This commit is contained in:
parent
87444e7109
commit
f446effcc5
1 changed files with 3 additions and 7 deletions
|
|
@ -1,6 +1,5 @@
|
|||
class UsersScenario < Scenario::Base
|
||||
def load
|
||||
create_preference
|
||||
create_user :login => 'johnny', :first_name => 'Johnny', :last_name => 'Smith'
|
||||
create_user :login => 'jane', :first_name => 'Jane', :last_name => 'Pilbeam'
|
||||
create_user :login => 'sean', :first_name => 'Sean', :last_name => 'Pallmer'
|
||||
|
|
@ -12,12 +11,9 @@ class UsersScenario < Scenario::Base
|
|||
:password => password,
|
||||
:password_confirmation => password,
|
||||
:is_admin => attributes[:is_admin] || false,
|
||||
:preference => preferences(:default)
|
||||
}.merge(attributes)
|
||||
create_model :user, attributes[:login].downcase.to_sym, attributes
|
||||
end
|
||||
|
||||
def create_preference
|
||||
create_record :preference, :default, :show_number_completed => 5
|
||||
identifier = attributes[:login].downcase.to_sym
|
||||
user = create_model :user, identifier, attributes
|
||||
Preference.create(:show_number_completed => 5, :user => user)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue