Sha256: a880b801119c7f25bc4f8ecd2e81162dc3f0acdae10ff42167bb65e9c2d1de36

Contents?: true

Size: 1023 Bytes

Versions: 11

Compression:

Stored size: 1023 Bytes

Contents

require "spec_helper"

describe "home tool", type: :feature, js: true do
  fixtures :all

  let(:statement) do
    social_networking_on_the_mind_statements(:participant2_statement1)
  end
  let(:participant1) { participants(:participant1) }
  let(:participant2) { participants(:participant2) }

  before do
    # generate profile
    visit "/social_networking/profile_page"
    visit "/social_networking/home"
  end

  def comment_on(item)
    find(:xpath, "//*[@id='#{ item_el_id(item) }']")
      .find("button.comment").click
  end

  def expand_comments_on(item)
    find(:xpath, "//*[@id='#{ item_el_id(item) }']")
      .find("button.comments").click
  end

  def like(item)
    find(:xpath, "//*[@id='#{ item_el_id(item) }']")
      .find("button.like").click
  end

  def have_likes_for(item)
    have_selector(
      :xpath,
      "//*[@id='#{ item_el_id(item) }']/" \
      "*[@class='actions']/button[@class='btn btn-link likes']"
    )
  end

  def item_el_id(item)
    "#{ item.class }-#{ item.id }"
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
social_networking-0.11.8 spec/features/home_tool_spec.rb
social_networking-0.11.7 spec/features/home_tool_spec.rb
social_networking-0.11.6 spec/features/home_tool_spec.rb
social_networking-0.11.5 spec/features/home_tool_spec.rb
social_networking-0.11.4 spec/features/home_tool_spec.rb
social_networking-0.11.3 spec/features/home_tool_spec.rb
social_networking-0.11.2 spec/features/home_tool_spec.rb
social_networking-0.11.1 spec/features/home_tool_spec.rb
social_networking-0.11.0 spec/features/home_tool_spec.rb
social_networking-0.10.0 spec/features/home_tool_spec.rb
social_networking-0.9.3 spec/features/home_tool_spec.rb