DEV: Ruby 3.1 compat (#19543)
* DEV: Ruby 3.1 compat * DEV: Add webrick to test/dev * DEV: Review ruby2_keywords license * move ruby2_keywords to ignored * move openssl to ignored
This commit is contained in:
parent
5443860130
commit
7c5744a4cb
|
@ -14,6 +14,8 @@ ignored:
|
|||
bundler:
|
||||
- rchardet # Ruby terms
|
||||
- strscan # Ruby
|
||||
- ruby2_keywords # BSD-2-Clause
|
||||
- openssl # Ruby terms
|
||||
|
||||
reviewed:
|
||||
bundler:
|
||||
|
@ -43,7 +45,6 @@ reviewed:
|
|||
- net-protocol # Ruby
|
||||
- net-smtp # Ruby
|
||||
- omniauth # MIT
|
||||
- openssl # Ruby terms
|
||||
- pg # Ruby terms
|
||||
- r2 # Apache-2.0 (Twitter)
|
||||
- racc # Ruby terms
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -169,6 +169,7 @@ group :test, :development do
|
|||
gem 'rswag-specs'
|
||||
|
||||
gem 'annotate'
|
||||
gem 'webrick', require: false
|
||||
end
|
||||
|
||||
group :development do
|
||||
|
|
|
@ -479,6 +479,7 @@ GEM
|
|||
webpush (1.1.0)
|
||||
hkdf (~> 0.2)
|
||||
jwt (~> 2.0)
|
||||
webrick (1.7.0)
|
||||
websocket (1.2.9)
|
||||
xorcist (1.1.3)
|
||||
xpath (3.2.0)
|
||||
|
@ -625,6 +626,7 @@ DEPENDENCIES
|
|||
webdrivers
|
||||
webmock
|
||||
webpush
|
||||
webrick
|
||||
xorcist
|
||||
yaml-lint
|
||||
|
||||
|
|
|
@ -1329,14 +1329,14 @@ RSpec.describe Chat::ChatController do
|
|||
|
||||
it "ensures message's channel can be seen" do
|
||||
Guardian.any_instance.expects(:can_join_chat_channel?).with(channel)
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
end
|
||||
|
||||
context "when the message doesn’t belong to the channel" do
|
||||
let!(:message) { Fabricate(:chat_message) }
|
||||
|
||||
it "returns a 404" do
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
|
||||
expect(response.status).to eq(404)
|
||||
end
|
||||
|
@ -1346,18 +1346,18 @@ RSpec.describe Chat::ChatController do
|
|||
let(:channel) { Fabricate(:category_channel) }
|
||||
|
||||
it "ensures the user can access that category" do
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["chat_messages"][0]["id"]).to eq(message.id)
|
||||
|
||||
group = Fabricate(:group)
|
||||
chatable.update!(read_restricted: true)
|
||||
Fabricate(:category_group, group: group, category: chatable)
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
expect(response.status).to eq(403)
|
||||
|
||||
GroupUser.create!(user: user, group: group)
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["chat_messages"][0]["id"]).to eq(message.id)
|
||||
end
|
||||
|
@ -1367,11 +1367,11 @@ RSpec.describe Chat::ChatController do
|
|||
let(:channel) { Fabricate(:direct_message_channel) }
|
||||
|
||||
it "ensures the user can access that direct message channel" do
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
expect(response.status).to eq(403)
|
||||
|
||||
DirectMessageUser.create!(user: user, direct_message: chatable)
|
||||
get "/chat/lookup/#{message.id}.json", { params: { chat_channel_id: channel.id } }
|
||||
get "/chat/lookup/#{message.id}.json", params: { chat_channel_id: channel.id }
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["chat_messages"][0]["id"]).to eq(message.id)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue