Sha256: 41806f05540e8b9390ebe33e0db6dc312f0a9ef199bd40e30a15fe056a1c25dd

Contents?: true

Size: 978 Bytes

Versions: 7

Compression:

Stored size: 978 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? exists?/ 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|publisher) named "([^"]*)" exists$/ do |type, name|
  first, last = name.split(" ")
  type = type.camelize.constantize
  type.create! :first_name => first, :last_name => last, :username => name
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
andrewroth_activeadmin-0.3.4 features/step_definitions/factory_steps.rb
activeadmin-0.3.4 features/step_definitions/factory_steps.rb
activeadmin-0.3.3 features/step_definitions/factory_steps.rb
activeadmin-0.3.2 features/step_definitions/factory_steps.rb
activeadmin-0.3.1 features/step_definitions/factory_steps.rb
activeadmin-0.3.0 features/step_definitions/factory_steps.rb
nsm-activeadmin-0.2.2 features/step_definitions/factory_steps.rb