Sha256: cd9ab6b3a2b2edd80e6daef6654917ba40a3d09973e9cc16d7693713c38229e5

Contents?: true

Size: 819 Bytes

Versions: 13

Compression:

Stored size: 819 Bytes

Contents

Given /^a comment$/ do
  attributes = { commentable: @project || @vacancy || @candidature }
  attributes[:user_id] ||= @me.id if @me
  @comment = Factory(:comment, attributes)
  @comment.reload
end

When /^I reply the (\d+)(?:st|nd|rd|th) comment$/ do |pos|
  find(:xpath, "//a[@class='new_comment'][#{pos.to_i}]").click
end

When /^I edit the (\d+)(?:st|nd|rd|th) comment$/ do |pos|
  find(:xpath, "//a[@class='edit_comment'][#{pos.to_i}]").click
end

When /^I delete the (\d+)(?:st|nd|rd|th) comment$/ do |pos|
  page.execute_script 'window.confirm = function () { return true }'
  find(:xpath, "//a[@class='destroy_comment'][#{pos.to_i}]").click
end

Then /^I should see the following comments:$/ do |expected_table|
  expected_table.hashes.each do |hash|
    steps %{Then I should see "#{hash['Name']}"}
  end  
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
voluntary-0.3.0 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.2.4 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.2.3 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.2.2 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.2.1 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.2.0 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.1.0 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.1.0.rc4 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.1.0.rc3 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.1.0.rc2 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.1.0.rc1 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.0.3 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb
voluntary-0.0.2 lib/generators/voluntary/product_dummy/templates/features/step_definitions/comment_steps.rb