* Add view for managing organizations This adds only an index and show action for the internal/organizations page. Eventually we'll flesh this out with features to automate the more mechanical org management tasks. * Use instance variable for search query * Convert multiple expects into one * Add pagination to organizations * Add search spec for organizations * Use size over count
18 lines
461 B
Ruby
18 lines
461 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe "Admin manages organizations", type: :system do
|
|
let(:admin) { create(:user, :super_admin) }
|
|
let(:organization) { create(:organization) }
|
|
|
|
before do
|
|
create_list :organization, 5
|
|
sign_in admin
|
|
visit "/internal/organizations"
|
|
end
|
|
|
|
it "searches for organizations" do
|
|
fill_in "search", with: organization.name.to_s
|
|
click_on "Search"
|
|
expect(page.body).to have_link(organization.name)
|
|
end
|
|
end
|