toggle_visibility_of_disabled_agents.rb 563 B

12345678910111213141516171819202122
  1. require 'capybara_helper'
  2. describe "Toggling the visibility of an agent", js: true do
  3. it "hides them if they are disabled" do
  4. login_as(users(:bob))
  5. visit("/agents")
  6. expect {
  7. click_on("Show/Hide Disabled Agents")
  8. }.to change{ find_all(".table-striped tr").count }.by(-1)
  9. end
  10. it "shows them when they are hidden" do
  11. login_as(users(:bob))
  12. visit("/agents")
  13. click_on("Show/Hide Disabled Agents")
  14. expect {
  15. click_on("Show/Hide Disabled Agents")
  16. }.to change{ find_all(".table-striped tr").count }.by(1)
  17. end
  18. end