Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4.6"
ruby-version: "4.0.2"
bundler-cache: true
- run: bundle exec rubocop
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
mongodb-version: "8.0"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4.6"
ruby-version: "4.0.2"
bundler-cache: true
- uses: GabrielBB/xvfb-action@v1
with:
Expand Down
15 changes: 5 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2025-10-02 12:37:09 UTC using RuboCop version 1.81.1.
# on 2026-03-20 11:14:51 UTC using RuboCop version 1.85.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -14,7 +14,7 @@ Capybara/SpecificActions:

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleAlignWith, Severity.
# Configuration parameters: EnforcedStyleAlignWith.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Layout/EndAlignment:
Exclude:
Expand Down Expand Up @@ -204,7 +204,8 @@ RSpec/RepeatedDescription:
- 'spec/slack-sup/commands/set_spec.rb'

# Offense count: 22
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata.
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
# SupportedInflectors: default, active_support
RSpec/SpecFilePathFormat:
Enabled: false

Expand All @@ -222,7 +223,7 @@ RSpec/StubbedMock:
- 'spec/slack-sup/commands/subscription_spec.rb'
- 'spec/slack-sup/commands/unsubscribe_spec.rb'

# Offense count: 11
# Offense count: 8
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
Expand Down Expand Up @@ -265,12 +266,6 @@ Style/IdenticalConditionalBranches:
Exclude:
- 'slack-sup/commands/set.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/MapToHash:
Exclude:
- 'spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'http://rubygems.org'

ruby '3.4.6'
ruby '4.0.2'

gem 'ambit'
gem 'bytesize'
Expand Down
43 changes: 26 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ GEM
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-follow_redirects (0.4.0)
faraday-follow_redirects (0.5.0)
faraday (>= 1, < 3)
faraday-mashify (1.0.0)
faraday-mashify (1.0.2)
faraday (~> 2.0)
hashie
faraday-multipart (1.1.1)
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (3.4.2)
net-http (~> 0.5)
Expand Down Expand Up @@ -147,7 +147,10 @@ GEM
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.18.1)
json (2.19.2)
json-schema (6.2.0)
addressable (~> 2.8)
bigdecimal (>= 3.1, < 5)
jwt (3.1.2)
base64
kaminari-core (1.2.2)
Expand All @@ -160,14 +163,18 @@ GEM
mailchimp_api_v3 (0.2.18)
rest-client (~> 2)
matrix (0.4.3)
mcp (0.9.0)
json-schema (>= 4.1)
metrics (0.15.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2025.0924)
mini_mime (1.1.5)
mini_portile2 (2.8.9)
minitest (5.26.0)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
mongo (2.21.3)
base64
bson (>= 4.14.1, < 6.0.0)
Expand Down Expand Up @@ -199,15 +206,17 @@ GEM
nokogiri (1.19.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.19.1-arm64-darwin)
racc (~> 1.4)
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.9.0)
parser (3.3.10.2)
ast (~> 2.4.1)
racc
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.5.2)
prism (1.9.0)
psych (5.2.6)
date
stringio
Expand Down Expand Up @@ -262,29 +271,30 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.6)
rubocop (1.81.1)
rubocop (1.85.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
mcp (~> 0.6)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.47.1)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.4)
prism (~> 1.7)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rake (0.7.1)
lint_roller (~> 1.1)
rubocop (>= 1.72.1)
rubocop-rspec (3.7.0)
rubocop-rspec (3.9.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop (~> 1.81)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
rubyzip (3.1.1)
Expand Down Expand Up @@ -344,10 +354,9 @@ GEM
uber (0.1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
unicode-emoji (4.2.0)
uri (1.1.1)
vcr (6.3.1)
base64
vcr (6.4.0)
wannabe_bool (0.7.1)
webmock (3.25.1)
addressable (>= 2.8.0)
Expand Down Expand Up @@ -414,7 +423,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.4.6p54
ruby 4.0.2p0

BUNDLED WITH
2.4.2
18 changes: 11 additions & 7 deletions spec/models/export_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
expect(export.team.slack_client).to receive(:chat_postMessage).with(
hash_including(
attachments: [
actions: [
text: 'Download',
type: 'button',
url: "#{SlackRubyBotServer::Service.url}/api/data/#{export.id}?access_token=token"
],
attachment_type: 'default',
text: ''
{
actions: [
{
text: 'Download',
type: 'button',
url: "#{SlackRubyBotServer::Service.url}/api/data/#{export.id}?access_token=token"
}
],
attachment_type: 'default',
text: ''
}
],
channel: 'dm',
text: 'Click here to download your team data.'
Expand Down
12 changes: 2 additions & 10 deletions spec/models/team_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@
end
end

context 'team created three weeks ago' do
let(:team) { Fabricate(:team, created_at: 3.weeks.ago) }
context 'team created over three weeks ago' do
let(:team) { Fabricate(:team, created_at: 3.weeks.ago - 1.day) }

it 'is asleep' do
expect(team.asleep?).to be true
Expand All @@ -153,14 +153,6 @@
end
end

context 'team created over three weeks ago' do
let(:team) { Fabricate(:team, created_at: 3.weeks.ago - 1.day) }

it 'is asleep' do
expect(team.asleep?).to be true
end
end

context 'team created over two weeks ago and subscribed' do
let(:team) { Fabricate(:team, created_at: 2.weeks.ago - 1.day, subscribed: true) }

Expand Down
2 changes: 1 addition & 1 deletion spec/slack-sup/app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
describe '#deactivate_asleep_teams!' do
let!(:active_team) { Fabricate(:team, created_at: Time.now.utc) }
let!(:active_team_one_week_ago) { Fabricate(:team, created_at: 1.week.ago) }
let!(:active_team_three_weeks_ago) { Fabricate(:team, created_at: 3.weeks.ago) }
let!(:active_team_three_weeks_ago) { Fabricate(:team, created_at: 3.weeks.ago - 1.day) }
let!(:subscribed_team_a_month_ago) { Fabricate(:team, created_at: 1.month.ago, subscribed: true) }

it 'destroys teams inactive for two weeks' do
Expand Down
4 changes: 2 additions & 2 deletions spec/support/api/endpoints/it_behaves_like_a_cursor_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
models_ids.concat(response.map { |instance| instance._links.self._url.gsub("http://example.org/api/#{model_ps}/", '') })
break unless response._links[:next]

next_cursor = CGI.parse(URI.parse(response._links.next._url).query).map { |a| [a[0], a[1][0]] }.to_h
next_cursor = URI.decode_www_form(URI.parse(response._links.next._url).query.to_s).to_h
end
expect(models_ids.uniq.count).to eq model.all.count
end
Expand All @@ -42,7 +42,7 @@
models_ids.concat(response.map { |instance| instance._links.self._url.gsub("http://example.org/api/#{model_ps}/", '') })
break unless response._links[:next]

next_cursor = CGI.parse(URI.parse(response._links.next._url).query).map { |a| [a[0], a[1][0]] }.to_h
next_cursor = URI.decode_www_form(URI.parse(response._links.next._url).query.to_s).to_h
end
expect(models_ids.uniq.count).to eq model.all.count - 3
end
Expand Down
Loading