2021-06-08 01:34:01 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
RSpec.describe DirectoryColumnsController do
|
2023-11-10 06:47:59 +08:00
|
|
|
fab!(:user)
|
|
|
|
fab!(:admin)
|
2021-06-08 01:34:01 +08:00
|
|
|
|
|
|
|
describe "#index" do
|
2021-06-23 02:00:04 +08:00
|
|
|
it "returns all active directory columns" do
|
|
|
|
likes_given = DirectoryColumn.find_by(name: "likes_given")
|
|
|
|
likes_given.update(enabled: false)
|
|
|
|
|
|
|
|
get "/directory-columns.json"
|
|
|
|
|
|
|
|
expect(response.parsed_body["directory_columns"].map { |dc| dc["name"] }).not_to include(
|
|
|
|
"likes_given",
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
2021-06-08 01:34:01 +08:00
|
|
|
end
|