Sha256: 27e23b08a10f2180063173e9addab535a76ed0d5dbc06013d273639741325a26

Contents?: true

Size: 1.51 KB

Versions: 23

Compression:

Stored size: 1.51 KB

Contents

require 'test_helper'

class ImagesIndexTest < ActionDispatch::IntegrationTest

  setup do
    visit(lentil.images_path)
    image = lentil_images(:one)
    @image_id = "#image_#{image.id}"
  end

  test "should have the content 'Your base app page title' on the index page" do
    assert page.has_content?('Your base app page title')
  end

  test "should have the titles of the images on the index page" do
    assert page.has_content?('six #hunttesting')
  end

  test "should have usernames of image contributors" do
    assert page.has_content?('bd')
  end

  # test "should be able to like vote for an image on the index page and see vote counts" do
  #   assert page.has_selector?("#{@image_id} .like_btn")
  #   assert page.has_selector?("#{@image_id} .like_count", :text => '0 votes')
  #   page.find("#{@image_id} .like_btn").click
  #   assert page.has_selector?("#{@image_id} .like_count", :text => '1 vote')
  # end

  # test "should only be able to like vote for an image one time" do
  #   page.find("#{@image_id} .like_btn").click
  #   assert page.has_selector?("#{@image_id} .like_count", :text => '1 vote')
  #   assert page.has_no_selector?("#{@image_id} .like_btn")
  # end

  test "should be able to flag an image as inappropriate" do
    assert page.has_selector?("#{@image_id} .flag-btn")
  end

  # test "should only be able to flag an image as inappropriate one time" do
  #   page.find("#{@image_id} .initial-state .flag-btn").click
  #   assert page.has_no_selector?("#{@image_id} .initial-state .flag-btn")
  # end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
lentil-1.0.5 test/integration/lentil/images_index_test.rb
lentil-1.0.4 test/integration/lentil/images_index_test.rb
lentil-1.0.3 test/integration/lentil/images_index_test.rb
lentil-1.0.2 test/integration/lentil/images_index_test.rb
lentil-1.0.1 test/integration/lentil/images_index_test.rb
lentil-1.0.0 test/integration/lentil/images_index_test.rb
lentil-0.9.1 test/integration/lentil/images_index_test.rb
lentil-0.9.0 test/integration/lentil/images_index_test.rb
lentil-0.8.0 test/integration/lentil/images_index_test.rb
lentil-0.7.1 test/integration/lentil/images_index_test.rb
lentil-0.6.0 test/integration/lentil/images_index_test.rb
lentil-0.5.2 test/integration/lentil/images_index_test.rb
lentil-0.5.1 test/integration/lentil/images_index_test.rb
lentil-0.5.0 test/integration/lentil/images_index_test.rb
lentil-0.4.2 test/integration/lentil/images_index_test.rb
lentil-0.4.0 test/integration/lentil/images_index_test.rb
lentil-0.3.1 test/integration/lentil/images_index_test.rb
lentil-0.3.0 test/integration/lentil/images_index_test.rb
lentil-0.2.3 test/integration/lentil/images_index_test.rb
lentil-0.2.2 test/integration/lentil/images_index_test.rb