Sha256: 21f0fcdf3e87aae998f9c1973ac4158f2ab050403b2c096f59013683d0d23b0f

Contents?: true

Size: 922 Bytes

Versions: 5

Compression:

Stored size: 922 Bytes

Contents

Given /^a post with the title "([^"]*)" exists$/ do |title|
  Post.create! :title => title
end

Given /^a post with the title "([^"]*)" and body "([^"]*)" exists$/ do |title, body|
  Post.create! :title => title, :body => body
end

Given /^a post with the title "([^"]*)" written by "([^"]*)" exists$/ do |title, author_name|
  first, last = author_name.split(' ')
  author = User.find_or_create_by_first_name_and_last_name(first, last, :username => author_name.gsub(' ', '').underscore)
  Post.create! :title => title, :author => author
end

Given /^(\d+) posts exist/ do |count|
  (0...count.to_i).each do |i|
    Post.create! :title => "Hello World #{i}"
  end
end

Given /^a category named "([^"]*)" exists$/ do |name|
  Category.create! :name => name
end

Given /^a user named "([^"]*)" exists$/ do |name|
  first, last = name.split(" ")
  User.create! :first_name => first, :last_name => last, :username => name
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
saulolso-activeadmin-0.2.2.1 features/step_definitions/factory_steps.rb
saulolso-activeadmin-0.2.2 features/step_definitions/factory_steps.rb
activeadmin-0.2.2 features/step_definitions/factory_steps.rb
activeadmin-0.2.1 features/step_definitions/factory_steps.rb
activeadmin-0.2.0 features/step_definitions/factory_steps.rb