mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 17:15:32 +08:00
0a5f548635
As part of this move, we are also renaming `discourse-chat` to `chat`.
47 lines
943 B
Ruby
47 lines
943 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
RSpec.describe Chat::EmojisController do
|
|
fab!(:user_1) { Fabricate(:user) }
|
|
|
|
before do
|
|
SiteSetting.chat_enabled = true
|
|
SiteSetting.chat_allowed_groups = Group::AUTO_GROUPS[:everyone]
|
|
sign_in(user_1)
|
|
end
|
|
|
|
describe "#index" do
|
|
before do
|
|
CustomEmoji.destroy_all
|
|
CustomEmoji.create!(name: "cat", upload: Fabricate(:upload))
|
|
Emoji.clear_cache
|
|
end
|
|
|
|
after do
|
|
CustomEmoji.destroy_all
|
|
Emoji.clear_cache
|
|
end
|
|
|
|
it "returns the emojis list" do
|
|
get "/chat/emojis.json"
|
|
|
|
expect(response.status).to eq(200)
|
|
expect(response.parsed_body.keys).to eq(
|
|
%w[
|
|
smileys_&_emotion
|
|
people_&_body
|
|
objects
|
|
travel_&_places
|
|
animals_&_nature
|
|
food_&_drink
|
|
activities
|
|
flags
|
|
symbols
|
|
default
|
|
],
|
|
)
|
|
end
|
|
end
|
|
end
|