Sha256: 87ec06edfd2b2f12840bd7d90df3e907e156c4ad5eb6dd6d615157f24fad73ef

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

require 'spec_helper'

describe ThemesOnRails::ControllerAdditions do
  let(:controller_class) { Class.new }
  let(:controller)       { controller_class.new }

  before do
    controller_class.send(:include, ThemesOnRails::ControllerAdditions)
  end

  it "invokes #apply_theme without options" do
    expect(ThemesOnRails::ActionController).to receive(:apply_theme).with(controller_class, "theme_a", {})

    controller_class.theme "theme_a"
  end

  it "invokes #apply_theme with options" do
    expect(ThemesOnRails::ActionController).to receive(:apply_theme).with(controller_class, :theme_resolver, { only: [:show] })

    controller_class.theme :theme_resolver, only: [:show]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
themes_on_rails-0.4.0 spec/lib/controller_additions_spec.rb
themes_on_rails-0.3.1 spec/lib/controller_additions_spec.rb