Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 08faaaad11dcba702942987435b136c9ab1f9d71 1 parent d6422fa
@mattetti authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.