Sha256: 35bb7cf16c706c53a9665df29123e805f15a857227791d135235b8f43b0230ad

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true
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

5 entries across 5 versions & 1 rubygems

Version Path
social_networking-0.13.3 spec/features/home_tool_spec.rb
social_networking-0.13.2 spec/features/home_tool_spec.rb
social_networking-0.13.1 spec/features/home_tool_spec.rb
social_networking-0.13.0 spec/features/home_tool_spec.rb
social_networking-0.12.0 spec/features/home_tool_spec.rb