require 'test_helper'

class FancyboxTest < ActionDispatch::IntegrationTest
  test "fancybox is loaded and works" do
    visit root_path

    fancybox = find('#fancybox-content')

    assert !fancybox.visible?

    click_link 'Check it out'
    assert fancybox.visible?
  end
end

require 'test_helper'

class FancyboxTest < ActionDispatch::IntegrationTest
  test "fancybox is loaded and works" do
    visit root_path

    fancybox = find('#fancybox-content', visible: false)

    assert !fancybox.visible?

    click_link 'Check it out'
    assert fancybox.visible?
  end
end

Fix tests to look for non-visible elements
Fix tests to look for non-visible elements

Capybara doesn't find hidden elements in its default configuration, you
have to explicitly ask for them.
