diff options
-rw-r--r-- | features/authors.feature | 3 | ||||
-rw-r--r-- | features/support/step_definitions/authors_steps.rb | 4 | ||||
-rw-r--r-- | spec/models/blog_posts_spec.rb | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/features/authors.feature b/features/authors.feature index 5bb5cea..a28d9ff 100644 --- a/features/authors.feature +++ b/features/authors.feature @@ -3,8 +3,7 @@ Feature: Blog Post Authors current_user is assumed through admin screens Scenario: Saving a blog post in blog_posts#new associates the current_user as the author - Given there is a user named "hubble" - And I am logged in as "hubble" + Given I am a logged in refinery user When I am on the new blog post form And I fill in "Title" with "This is my blog post" diff --git a/features/support/step_definitions/authors_steps.rb b/features/support/step_definitions/authors_steps.rb index 6f695ca..7dd30ac 100644 --- a/features/support/step_definitions/authors_steps.rb +++ b/features/support/step_definitions/authors_steps.rb @@ -1,5 +1,5 @@ Given /^there is a user named "([^\"]*)"$/ do |login| - @user = Factory.create(:user, :login => login, :password => "#{login}-123", :password_confirmation => "#{login}-123") + @user = Factory.create(:user, :login => login) end Then /^there should be (\d+) blog posts?$/ do |num| @@ -7,5 +7,5 @@ Then /^there should be (\d+) blog posts?$/ do |num| end Then /^the blog post should belong to "([^\"]*)"$/ do |login| - BlogPost.last.author.login == login + BlogPost.first.author.login == login end
\ No newline at end of file diff --git a/spec/models/blog_posts_spec.rb b/spec/models/blog_posts_spec.rb index 6b5edcb..ef1cbf8 100644 --- a/spec/models/blog_posts_spec.rb +++ b/spec/models/blog_posts_spec.rb @@ -49,7 +49,7 @@ describe BlogPost do describe "authors" do it "are authored" do - BlogPost.new.methods.should include(:author) + BlogPost.instance_methods.map(&:to_sym).include? :author end end |