Permalink
Browse files

fixed the user creation problem by not going thru the stack since we …

…don't have a user controller yet
  • Loading branch information...
1 parent d6422fa commit 08faaaad11dcba702942987435b136c9ab1f9d71 @mattetti committed Nov 15, 2008
View
1 step-by-step-app-testing/steps/authenticate_articles_route.rb
@@ -8,6 +8,7 @@ def authenticate_articles_route
authenticate do
#{sentinel}
end
+ resource :users
RUBY
end
end
View
13 step-by-step-app-testing/steps/authenticated_articles_route_spec.rb
@@ -44,17 +44,8 @@ def add_login_spec_helpers
Merb::Test.add_helpers do
def create_default_user
- if User.first(:login => "krusty").nil?
- request(resource(:users), {
- :method => "POST",
- :params => {
- :user => {
- :login => "krusty",
- :password => "klown",
- :password_confirmation => "klown"
- }
- }
- })
+ unless User.first(:login => "krusty")
+ User.create(:login => "krusty", :password => "klown", :password_confirmation => "klown") or raise "can't create user'"
end
end

0 comments on commit 08faaaa

Please sign in to comment.