Sha256: 597006015d3d25c531fb709b8ea0585f803deba64f423c693f265b7312b5ad51

Contents?: true

Size: 756 Bytes

Versions: 5

Compression:

Stored size: 756 Bytes

Contents

require "spec_helper"

describe MobileEnhancements::RouteHelpers do
  subject do
    Class.new do
      include MobileEnhancements::RouteHelpers
      
      def scopes
        @scopes
      end
      
      def scope(*args)
        @scopes ||= []
        @scopes << args
      end
    end.new
  end
  
  context "given a mobile_optional block" do
    before do
      subject.mobile_optional do
        resources :items
      end
    end

    it "should define a scope" do
      expect(subject.scopes.size).to eq 1
    end
  end
  
  context "given a mobile_only block" do
    before do
      subject.mobile_only do
        resources :items
      end
    end
  
    it "should define a scope" do
      expect(subject.scopes.size).to eq 1
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mobile-enhancements-0.0.5 spec/mobile_enhancements/route_helpers_spec.rb
mobile-enhancements-0.0.4 spec/mobile_enhancements/route_helpers_spec.rb
mobile-enhancements-0.0.3 spec/mobile_enhancements/route_helpers_spec.rb
mobile-enhancements-0.0.2 spec/mobile_enhancements/route_helpers_spec.rb
mobile-enhancements-0.0.1 spec/mobile_enhancements/route_helpers_spec.rb