From 6a3cf5d6a695e9394a73bd429dbeae3787a3963e Mon Sep 17 00:00:00 2001 From: Joe Sak Date: Thu, 24 Feb 2011 21:32:37 -0600 Subject: WIP: trying to test user association as author --- features/support/step_definitions/authors_steps.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 features/support/step_definitions/authors_steps.rb (limited to 'features/support') diff --git a/features/support/step_definitions/authors_steps.rb b/features/support/step_definitions/authors_steps.rb new file mode 100644 index 0000000..6f695ca --- /dev/null +++ b/features/support/step_definitions/authors_steps.rb @@ -0,0 +1,11 @@ +Given /^there is a user named "([^\"]*)"$/ do |login| + @user = Factory.create(:user, :login => login, :password => "#{login}-123", :password_confirmation => "#{login}-123") +end + +Then /^there should be (\d+) blog posts?$/ do |num| + BlogPost.all.size == num +end + +Then /^the blog post should belong to "([^\"]*)"$/ do |login| + BlogPost.last.author.login == login +end \ No newline at end of file -- cgit v1.2.3