Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dannnylo committed Oct 12, 2024
1 parent 3f2c036 commit d582cb0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/sidekiq/web_action_helper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: false

RSpec.describe(Sidekiq::WebActionHelper) do
describe ".render" do
describe "ERB" do
let(:dummy_web_action) do
Class.new do
def env
Expand Down Expand Up @@ -30,7 +30,8 @@ def render(_engine, content, _options = {})
end

it "replaces the page content with the block content" do
expect(dummy_web_action.new.render("erb", "<a>Sidekiq default<a>")).to eq("<a>Sidekiq replaced twice<a>")
dummy_web_action::ERB.path_info = "/"
expect(dummy_web_action::ERB.new("<a>Sidekiq default<a>").result).to eq("<a>Sidekiq replaced twice<a>")
end
end

Expand All @@ -40,7 +41,8 @@ def render(_engine, content, _options = {})
end

it "replaces the page content with the block content" do
expect(dummy_web_action.new.render("erb", "<a>Sidekiq default<a>")).to eq("<a>Sidekiq default<a>")
dummy_web_action::ERB.path_info = "/"
expect(dummy_web_action::ERB.new("<a>Sidekiq default<a>").result).to eq("<a>Sidekiq default<a>")
end
end
end
Expand Down

0 comments on commit d582cb0

Please sign in to comment.