Sha256: f1806985e398ba6a27a4589975a64c64ba3cc4baeb541dac8b103b6084c16425

Contents?: true

Size: 1.1 KB

Versions: 20

Compression:

Stored size: 1.1 KB

Contents

Then /^I should see a comment by "([^"]*)"$/ do |name|
  step %{I should see "#{name}" within ".active_admin_comment_author"}
end

When /^I add a comment "([^"]*)"$/ do |comment|
  step %{I fill in "active_admin_comment_body" with "#{comment}"}
  step %{I press "Add Comment"}
end

Given /^a tag with the name "([^"]*)" exists$/ do |tag_name|
  Tag.create(name: tag_name)
end

Given /^(a|\d+) comments added by admin with an email "([^"]+)"?$/ do |number, email|
  number = number == 'a' ? 1 : number.to_i
  admin_user = ensure_user_created(email)

  comment_text = 'Comment %i'

  number.times do |i|
    ActiveAdmin::Comment.create!(namespace:     'admin',
                                 body:          comment_text % i,
                                 resource_type: Post.to_s,
                                 resource_id:   Post.first.id,
                                 author_type:   admin_user.class.to_s,
                                 author_id:     admin_user.id)
  end
end

Then /^I should see (\d+) comments?$/ do |number|
  expect(page).to have_selector('div.active_admin_comment', count: number.to_i)
end

Version data entries

20 entries across 20 versions & 4 rubygems

Version Path
activeadmin-rails-1.7.2 features/step_definitions/comment_steps.rb
activeadmin-rails-1.7.1 features/step_definitions/comment_steps.rb
activeadmin-rails-1.7.0 features/step_definitions/comment_steps.rb
activeadmin-rb-1.6.0 features/step_definitions/comment_steps.rb
activeadmin-rb-1.5.2 features/step_definitions/comment_steps.rb
activeadmin-rb-1.5.1 features/step_definitions/comment_steps.rb
activeadmin-rb-1.5.0 features/step_definitions/comment_steps.rb
activeadmin_addons-1.7.1 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin-rb-1.4.0 features/step_definitions/comment_steps.rb
activeadmin_addons-1.7.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin-1.3.1 features/step_definitions/comment_steps.rb
activeadmin_addons-1.6.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin_addons-1.5.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin-1.3.0 features/step_definitions/comment_steps.rb
activeadmin_addons-1.4.0 vendor/bundle/ruby/2.2.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin_addons-1.3.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin_addons-1.2.0 vendor/bundle/ruby/2.3.0/bundler/gems/activeadmin-f71b375325eb/features/step_definitions/comment_steps.rb
activeadmin-1.2.1 features/step_definitions/comment_steps.rb
activeadmin-1.2.0 features/step_definitions/comment_steps.rb
activeadmin-1.1.0 features/step_definitions/comment_steps.rb