Skip to content

Commit

Permalink
fix: test with patched rspec-rails
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Sep 13, 2024
1 parent 7933b1c commit b8bf38d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["3.2"]
gemfile: ["rails8"]
ruby: []
gemfile: []
include:
- ruby: "3.3"
gemfile: "railsmaster"
- ruby: "3.2"
gemfile: "anycablemaster"
# - ruby: "3.2"
# gemfile: "anycablemaster"
# - ruby: "3.2"
# gemfile: "rails8"
steps:
- uses: actions/checkout@v4
- name: Install system deps
Expand Down
4 changes: 1 addition & 3 deletions gemfiles/anycablemaster.gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
source "https://rubygems.org"

# gem "rails", ">= 8.0"
gem "rails", git: "https://github.com/palkan/rails.git", branch: "refactor/action-cable-server-adapterization"

gem "rails", ">= 8.0"
gem "rspec-rails"
gem "anycable", git: "https://github.com/anycable/anycable.git", branch: "master"
gem "sqlite3"
Expand Down
8 changes: 3 additions & 5 deletions gemfiles/rails8.gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
source "https://rubygems.org"

# gem "actioncable", "~> 8.0"
# gem "activerecord"
# gem "activejob"
gem "rails", git: "https://github.com/palkan/rails.git", branch: "refactor/action-cable-server-adapterization"

gem "actioncable", "~> 8.0"
gem "activerecord"
gem "activejob"
gem "rspec-rails"
gem "sqlite3"

Expand Down
8 changes: 7 additions & 1 deletion gemfiles/railsmaster.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
source "https://rubygems.org"

gem "rails", git: "https://github.com/palkan/rails.git", branch: "refactor/action-cable-server-adapterization"
gem "rspec-rails"
gem "rspec-rails", git: "https://github.com/palkan/rspec-rails.git", branch: "feat/actioncable-v8"

gem "rspec-core", git: "https://github.com/rspec/rspec-core.git"
gem "rspec-support", git: "https://github.com/rspec/rspec-support.git"
gem "rspec-expectations", git: "https://github.com/rspec/rspec-expectations.git"
gem "rspec-mocks", git: "https://github.com/rspec/rspec-mocks.git"

gem "sqlite3"

gemspec path: "..", name: "anycable-rails"
12 changes: 4 additions & 8 deletions spec/integrations/action_cable_testing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ def connection_class
specify "subscription" do
subscribe
expect(subscription).to be_confirmed
# FIXME: rspec-rails integration
expect(testserver.streams).to include("test")
# expect(subscription).to have_stream_from("test")
expect(subscription).to have_stream_from("test")
end

specify "rejection" do
Expand All @@ -37,13 +35,11 @@ def connection_class

perform :itick

# FIXME: rspec-rails integration
expect(transmissions.last["message"]).to eq("result" => 1)
expect(transmissions.last).to eq("result" => 1)

perform :itick

# FIXME: rspec-rails integration
expect(transmissions.last["message"]).to eq("result" => 2)
expect(transmissions.last).to eq("result" => 2)
end
end

Expand Down Expand Up @@ -76,7 +72,7 @@ def connection_class
}
)

expect(transmissions.last["type"]).to eq("confirm_subscription")
expect(socket.transmissions.last["type"]).to eq("confirm_subscription")
expect(ApplicationCable::Connection.events_log.last[:source]).to eq "command"
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/anycable/rails/ext/signed_streams_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def connection_class

let(:conn) { connect }

let(:transmission) { transmissions.last }
let(:transmission) { socket.transmissions.last }

let(:user) { User.create!(name: "jack") }

Expand Down

0 comments on commit b8bf38d

Please sign in to comment.