Sha256: b48a5001c2917f07ea71d8fb670ecb39878ca042a78d112665cc0174f2475c8b

Contents?: true

Size: 1.97 KB

Versions: 20

Compression:

Stored size: 1.97 KB

Contents

require 'spec_helper'

if Jasmine::Dependencies.rails3?

  describe "A Rails 3 app" do

    before :each do
      temp_dir_before
      Dir::chdir @tmp

      create_rails 'rails-example'
      Dir::chdir 'rails-example'
      open('Gemfile', 'a') { |f| f.puts "gem \"jasmine\", \"#{Jasmine::VERSION}\"" }
    end

    after :each do
      temp_dir_after
    end

    context "when Jasmine has been required" do
      it "should show the Jasmine generators" do
        output = `rails g`
        output.should include("jasmine:install")
        output.should include("jasmine:examples")
      end

      it "should show jasmine:install help" do
        output = `rails g jasmine:install --help`
        output.should include("rails generate jasmine:install")
      end

      it "should have the jasmine rake task" do
        output = `rake -T`
        output.should include("jasmine ")
      end

      it "should have the jasmine:ci rake task" do
        output = `rake -T`
        output.should include("jasmine:ci")
      end

      context "and then installed" do
        before :each do
          @output = `rails g jasmine:install`
        end

        it "should have the Jasmine config files" do
          @output.should include("create")

          File.exists?("spec/javascripts/helpers/.gitkeep").should == true
          File.exists?("spec/javascripts/support/jasmine.yml").should == true
        end
      end

      context "and the jasmine examples have been installed" do
        it "should find the Jasmine example files" do
          output = `rails g jasmine:examples`
          output.should include("create")

          File.exists?("app/assets/javascripts/jasmine_examples/Player.js").should == true
          File.exists?("app/assets/javascripts/jasmine_examples/Song.js").should == true

          File.exists?("spec/javascripts/jasmine_examples/PlayerSpec.js").should == true
          File.exists?("spec/javascripts/helpers/SpecHelper.js").should == true
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
rally-jasmine-1.2.0.18 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.12 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.11 spec/jasmine_rails3_spec.rb
jasmine-multi_json-1.3.2.1 spec/jasmine_rails3_spec.rb
jasmine-1.3.2 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.10 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.8 spec/jasmine_rails3_spec.rb
jasmine-multi_json-1.3.1.1 spec/jasmine_rails3_spec.rb
jasmine-1.3.1 spec/jasmine_rails3_spec.rb
jasmine-1.3.0 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.7 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.6 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.5 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.4 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.3 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.2 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0.1 spec/jasmine_rails3_spec.rb
rally-jasmine-1.2.0 spec/jasmine_rails3_spec.rb
jasmine-1.2.1 spec/jasmine_rails3_spec.rb
jasmine-1.2.0 spec/jasmine_rails3_spec.rb