Skip to content

Commit

Permalink
Simpler test for I18n namespace conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Apr 8, 2021
1 parent b2aaa01 commit 3eef450
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
8 changes: 0 additions & 8 deletions test/mock_helpers/application_helper.rb

This file was deleted.

4 changes: 4 additions & 0 deletions test/mock_helpers/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def initialize(url='http://example.com:3000/foo?page=2')
@url = url
end

def test_i18n_call
I18n.t('test')
end

def request
Rack::Request.new(Rack::MockRequest.env_for(@url))
end
Expand Down
8 changes: 3 additions & 5 deletions test/pagy/extras/i18n_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@

SimpleCov.command_name 'i18n' if ENV['RUN_SIMPLECOV'] == 'true'

require_relative '../../mock_helpers/application_helper'
include ApplicationHelper

describe Pagy::Frontend do

let(:view) { MockView.new }

describe "#pagy_t with I18n" do
it 'works with an included Module' do
ApplicationHelper.any_method_name()

it 'does not conflict with the I18n gem namespace' do
view.test_i18n_call
end

it 'pluralizes' do
Expand Down

0 comments on commit 3eef450

Please sign in to comment.