Sha256: 2172dcd7a3b1dd0da6d0fafa72c6a59fb3630e78d672f812826d4ed5722431e3

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe Guilded::Rails::ViewHelpers do

  class Includer
    include Guilded::Rails::ViewHelpers

    # stub raw
    def raw( str )
      str
    end
  end

  subject do
    Includer.new
  end

  context "when the environment is development" do

    before :each do
      Guilded.configure do |config|
        config.environment = :development
        config.jquery_version = '1.8.3'
      end
    end

    it "should output the correct jquery include tag" do
      subject.jquery_include_tag.should == "<script src=\"/assets/jquery-1.8.3.js\" type=\"text/javascript\"></script>"
    end

  end

  context "when the environment is production" do

    before :each do
      Guilded.configure do |config|
        config.environment = :production
        config.jquery_google_url_template = "https://ajax.googleapis.com/ajax/libs/jquery/{{version}}/jquery.min.js"
        config.jquery_version = '1.8.3'
      end
    end

    it "should output the correct jquery include tag" do
      subject.jquery_include_tag.should == "<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\" type=\"text/javascript\"></script>"
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
guilded-2.0.0 spec/guilded/rails/view_helpers_spec.rb
guilded-2.0.0.pre spec/guilded/rails/view_helpers_spec.rb