Skip to content

Commit

Permalink
Merge 2e55494 into 6e3e74e
Browse files Browse the repository at this point in the history
  • Loading branch information
joebutler2 committed Nov 10, 2019
2 parents 6e3e74e + 2e55494 commit e2b1544
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dragonfly/lib/refinery/dragonfly/dragonfly.rb
Expand Up @@ -32,7 +32,7 @@ def configure!(extension)

# These options require a name and block
define_url extension.dragonfly_define_url if extension.dragonfly_define_url.present?
before_serve extension.dragonfly_before_serve if extension.dragonfly_before_serve.present?
before_serve(&extension.dragonfly_before_serve) if extension.dragonfly_before_serve.present?


# There can be more than one instance of each of these options.
Expand Down
3 changes: 1 addition & 2 deletions dragonfly/refinerycms-dragonfly.gemspec
@@ -1,10 +1,9 @@
# Encoding: UTF-8


Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-dragonfly}
s.version = '1.0.1'
s.version = '1.0.2'
s.summary = %q{Dragonfly interface for Refinery CMS}
s.description = %q{Allows Refinery to use dragonfly for file storage and processing}
s.email = %q{anita@joli.com.au}
Expand Down
12 changes: 12 additions & 0 deletions resources/spec/lib/refinery/resources/engine_spec.rb
Expand Up @@ -4,5 +4,17 @@ module Refinery
describe Resources do
it_has_behaviour 'Creates a dragonfly App:'
it_has_behaviour 'adds the dragonfly app to the middleware stack'

it 'calls dragonfly#before_serve to set configuration' do
dummy_proc = -> (_job, _env) {}
expect_any_instance_of(::Dragonfly::Server).to(
receive(:before_serve) { |&block| expect(block).to be(dummy_proc) }
)
::Refinery::Resources.configure do |config|
config.dragonfly_before_serve = dummy_proc
end

::Refinery::Dragonfly.configure!(::Refinery::Resources)
end
end
end

0 comments on commit e2b1544

Please sign in to comment.