Sha256: 0eae741c25f356bd25a37806b7ce88cb628b4f4843b03b145f465d494ffcfecd

Contents?: true

Size: 1.53 KB

Versions: 16

Compression:

Stored size: 1.53 KB

Contents

require 'spec_helper'

module Landable
  # descriptions
  describe VariablesConcern, type: :controller do
    # setup
    controller(ApplicationController) do
      protected
        def hello_world
          "i live in a giant bucket."
        end

        def hello_cleveland
          "i am a banana."
        end
    end

    after(:each) do
      controller.class.imported_variables.clear
    end

    before(:each) do
      controller.class.instance_exec do
        register_landable_variable :hello_world
        register_landable_variable :is_rejected, :hello_cleveland
      end
    end

    # tests
    it "should include the VariablesConcern module" do
      # setup
      # actions
      # expectations
      expect(controller).to be_a Landable::VariablesConcern
      # end
    end

    it "should use the #register_landable_variable with a similarly named method" do
      # setup
      # actions
      # expectations
      expect(controller.fetch_landable_variables[:hello_world]).to eql("i live in a giant bucket.")
      # end
    end

    it "should use the #register_landable_variable with a custom named method" do
      # setup
      # actions
      # expectations
      expect(controller.fetch_landable_variables[:is_rejected]).to eql("i am a banana.")
      # end
    end

    it "should use the #register_landable_variable with a string-based name" do
      # setup
      # actions
      # expectations
      expect(controller.fetch_landable_variables['is_rejected']).to eql("i am a banana.")
      # end
    end

    # end
  end

  # end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
landable-1.13.1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.12.3 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.12.2 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.12.1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.11.1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.11.0 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.10.0.rc2 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.10.0.rc1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.9.2 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.9.1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.9.0 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.9.0.rc2 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.9.0.rc1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.8.0 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.7.1.rc1 spec/controllers/concerns/landable/variables_concern_spec.rb
landable-1.7.0 spec/controllers/concerns/landable/variables_concern_spec.rb