Sha256: cb74443e8d4bbf90be2ceaa03be2a608eae4e80e7fd7872218a299b03e1e7ed9

Contents?: true

Size: 927 Bytes

Versions: 15

Compression:

Stored size: 927 Bytes

Contents

require 'spec_helper'
require 'nokogiri'
require 'ostruct'

describe Jasmine::Page do
  describe "#render" do
    subject { Nokogiri::HTML(page.render) }
    let(:fake_config) do
      OpenStruct.new(:js_files => ["file1.js", "file2.js"],
                     :css_files => ["file1.css", "file2.css"],
                     :jasmine_files => ["jasmine_file1.js", "jasmine_file2.js"])
    end
    let(:context) { fake_config }
    let(:page) { Jasmine::Page.new(context) }
    it "should render javascript files in the correct order" do
      js_files = subject.css("script")
      js_files.map { |file| file["src"] }.compact.should == ["jasmine_file1.js", "jasmine_file2.js", "file1.js", "file2.js"]
    end

    it "should render css files in the correct order" do
      css_files = subject.css("link[type='text/css']")
      css_files.map { |file| file["href"] }.compact.should == ["file1.css", "file2.css"]
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rally-jasmine-1.2.0.18 spec/page_spec.rb
rally-jasmine-1.2.0.12 spec/page_spec.rb
rally-jasmine-1.2.0.11 spec/page_spec.rb
rally-jasmine-1.2.0.10 spec/page_spec.rb
rally-jasmine-1.2.0.8 spec/page_spec.rb
jasmine-1.3.0 spec/page_spec.rb
rally-jasmine-1.2.0.7 spec/page_spec.rb
rally-jasmine-1.2.0.6 spec/page_spec.rb
rally-jasmine-1.2.0.5 spec/page_spec.rb
rally-jasmine-1.2.0.4 spec/page_spec.rb
rally-jasmine-1.2.0.3 spec/page_spec.rb
rally-jasmine-1.2.0.2 spec/page_spec.rb
rally-jasmine-1.2.0.1 spec/page_spec.rb
rally-jasmine-1.2.0 spec/page_spec.rb
jasmine-1.2.1 spec/page_spec.rb