discourse-chat-integration/spec/requests/public_controller_spec.rb

25 lines
651 B
Ruby
Raw Normal View History

# frozen_string_literal: true
RSpec.describe "Public Controller", type: :request do
before { SiteSetting.chat_integration_enabled = true }
2017-08-01 15:53:39 -04:00
describe "loading a transcript" do
it "should be able to load a transcript" do
key = DiscourseChatIntegration::Helper.save_transcript("Some content here")
get "/chat-transcript/#{key}.json"
2018-06-07 20:57:43 -04:00
expect(response.status).to eq(200)
expect(response.body).to eq('{"content":"Some content here"}')
end
it "should 404 for non-existent transcript" do
key = "abcdefghijk"
get "/chat-transcript/#{key}.json"
2018-06-07 20:57:43 -04:00
expect(response.status).to eq(404)
end
end
end