Replace anonymous class in ActsAsOpEngine spec

Rails 4.2 is not able generate an appropriate `railtie_name` (aliased
to `engine_name`) for anonymous classes - this, in turn, breaks
initializer definitions.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/3421/head
Alex Coles 9 years ago
parent edd5bb51b7
commit fb82c9c1ba
  1. 16
      spec/lib/open_project/plugins/acts_as_op_engine_spec.rb

@ -30,12 +30,12 @@ require 'spec_helper'
require 'roar/decorator'
describe OpenProject::Plugins::ActsAsOpEngine do
subject(:engine) do
Class.new(Rails::Engine) do
include OpenProject::Plugins::ActsAsOpEngine
end
class ActsAsOpEngineTestEngine < Rails::Engine
include OpenProject::Plugins::ActsAsOpEngine
end
subject(:engine) { ActsAsOpEngineTestEngine }
it { is_expected.to respond_to(:name) }
it { is_expected.to respond_to(:patches) }
it { is_expected.to respond_to(:assets) }
@ -43,13 +43,9 @@ describe OpenProject::Plugins::ActsAsOpEngine do
it { is_expected.to respond_to(:register) }
describe '#name' do
before do
Object.const_set('SuperCaliFragilisticExpialidocious', engine)
end
describe '#name' do
subject { super().name }
it { is_expected.to eq 'SuperCaliFragilisticExpialidocious' }
subject { engine.name }
it { is_expected.to eq 'ActsAsOpEngineTestEngine' }
end
end

Loading…
Cancel
Save