Skip to content

Commit

Permalink
Fix Capybara/VisibilityMatcher RuboCop offenses
Browse files Browse the repository at this point in the history
`visible: false` is now `visible: :hidden` and `visible: true` is now
`visible: :visible`.
  • Loading branch information
Dany Marcoux committed May 4, 2020
1 parent 8bc95ee commit 48e503b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/api/spec/features/webui/image_templates_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
end

expect(page).to have_text(package1.title)
expect(page).to have_selector("input[data-package='#{package1}']:checked", visible: false)
expect(page).to have_selector("input[data-package='#{package2}']:not(:checked)", visible: false)
expect(page).to have_selector("input[data-package='#{package3}']:not(:checked)", visible: false)
expect(page).to have_selector("input[data-package='#{kiwi_package}']:not(:checked)", visible: false)
expect(page).to have_selector("input[data-package='#{package1}']:checked", visible: :hidden)
expect(page).to have_selector("input[data-package='#{package2}']:not(:checked)", visible: :hidden)
expect(page).to have_selector("input[data-package='#{package3}']:not(:checked)", visible: :hidden)
expect(page).to have_selector("input[data-package='#{kiwi_package}']:not(:checked)", visible: :hidden)

expect(page).to have_field('target_package', with: package1)
within :xpath, "//input[@data-package='#{package2}']/../label" do
Expand All @@ -59,10 +59,10 @@
end

expect(page).to have_text(package1.title)
expect(page).to have_selector("input[data-package='#{package1}']:checked", visible: false)
expect(page).to have_selector("input[data-package='#{package2}']:not(:checked)", visible: false)
expect(page).to have_selector("input[data-package='#{package3}']:not(:checked)", visible: false)
expect(page).to have_selector("input[data-package='#{kiwi_package}']:not(:checked)", visible: false)
expect(page).to have_selector("input[data-package='#{package1}']:checked", visible: :hidden)
expect(page).to have_selector("input[data-package='#{package2}']:not(:checked)", visible: :hidden)
expect(page).to have_selector("input[data-package='#{package3}']:not(:checked)", visible: :hidden)
expect(page).to have_selector("input[data-package='#{kiwi_package}']:not(:checked)", visible: :hidden)

expect(page).to have_field('target_package', with: package1)
within :xpath, "//input[@data-package='#{kiwi_package}']/../label" do
Expand Down
16 changes: 8 additions & 8 deletions src/api/spec/features/webui/maintained_projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@
visit project_maintained_projects_path(project_name: maintenance_project.name)

expect(page).to have_text('Maintained Projects')
expect(page).to have_selector('#new-maintenance-project-modal', visible: false)
expect(page).to have_selector('#delete-maintained-project-modal', visible: false)
expect(page).to have_selector('#new-maintenance-project-modal', visible: :hidden)
expect(page).to have_selector('#delete-maintained-project-modal', visible: :hidden)
end

scenario 'click on add new project' do
login admin_user
visit project_maintained_projects_path(project_name: maintenance_project.name)

expect(page).to have_selector('#new-maintenance-project-modal', visible: false)
expect(page).to have_selector('#new-maintenance-project-modal', visible: :hidden)
click_link('Add Project to Maintain')

expect(page).to have_selector('#new-maintenance-project-modal', visible: true)
expect(page).to have_selector('#delete-maintained-project-modal', visible: false)
expect(page).to have_selector('#new-maintenance-project-modal', visible: :visible)
expect(page).to have_selector('#delete-maintained-project-modal', visible: :hidden)
end

scenario 'click on delete project' do
login admin_user
visit project_maintained_projects_path(project_name: maintenance_project.name)

expect(page).to have_selector('#new-maintenance-project-modal', visible: false)
expect(page).to have_selector('#new-maintenance-project-modal', visible: :hidden)

click_link('Delete Project')

expect(page).to have_selector('#new-maintenance-project-modal', visible: false)
expect(page).to have_selector('#delete-maintained-project-modal', visible: true)
expect(page).to have_selector('#new-maintenance-project-modal', visible: :hidden)
expect(page).to have_selector('#delete-maintained-project-modal', visible: :visible)
end

scenario 'delete project' do
Expand Down

0 comments on commit 48e503b

Please sign in to comment.