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.94 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.92 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.90 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.84 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.80 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.79 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.78 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.77 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.74 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.73 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.72 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.71 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.66 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.65 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
activeadmin-0.6.0 features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.64 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.63 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.62 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.61 vendor/deps/active_admin/features/step_definitions/factory_steps.rb
lalala-4.0.0.dev.60 vendor/deps/active_admin/features/step_definitions/factory_steps.rb