Sha256: 89d96b03da4d31e9b82b5274fcc84c02a89e25b1018417f6813c01292da4abbb

Contents?: true

Size: 1.78 KB

Versions: 50

Compression:

Stored size: 1.78 KB

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 (published )?post with the title "([^"]*)" written by "([^"]*)" exists$/ do |published, 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)
  published_at = published ? Time.now : nil
  Post.create! :title => title, :author => author, :published_at => published_at
end

Given /^(\d+)( published)? posts? written by "([^"]*)" exist$/ do |count, published, 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)
  (0...count.to_i).each do |i|
    Post.create! :title => "Hello World #{i}", :author => author, :published_at => (published ? Time.now : nil)
  end
end

Given /^(\d+)( published)? posts? exists?$/ do |count, published|
  (0...count.to_i).each do |i|
    Post.create! :title => "Hello World #{i}", :published_at => (published ? Time.now : nil)
  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

Given /^I create a new post with the title "([^"]*)"$/ do |title|
  click_link "Posts"
  click_link "New Post"
  fill_in :title, :with => title
  click_button "Create Post"
end

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

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
lalala-4.0.0.dev.141 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.136 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.135 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.134 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.133 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.132 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.131 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.129 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.128 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.126 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.125 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.124 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.123 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.118 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.116 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.114 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.113 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.111 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.109 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.107 vendor/deps/active_admin/features/step_definitions/factory_steps.rb