docbrown/spec/system/admin/admin_manages_organizations_spec.rb
Mac Siri 842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00

29 lines
826 B
Ruby

require "rails_helper"
RSpec.describe "Admin manages organizations" do
let(:admin) { create(:user, :super_admin) }
let(:organization) { create(:organization) }
before { sign_in admin }
context "when searching for organizations" do
it "searches for organizations" do
create_list(:organization, 5)
visit admin_organizations_path
fill_in "search", with: organization.name.to_s
click_on "Search"
expect(page.body).to have_link(organization.name)
end
end
context "when managing credits for a single organization" do
before { visit admin_organization_path(organization) }
it "does not show the remove form when there are no credits" do
expect(page).to have_button("Add Org Credits")
expect(page).not_to have_button("Remove Org Credits")
end
end
end