Sha256: 6cf6035a57e4627f1f0ad63d39071ede4f3393fde49cc8a288b79e2a9232ac24

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe 'rails assets' do
  before do
    mock_config do
      use_recipe :rails_assets
      set :deploy_to, '/foo/bar'
    end
  end

  it 'uses rails recipe' do
    config.should be_using_recipe(:rails)
  end

  describe 'deploy:assets:precompile' do
    it 'runs precompile' do
      cli_execute 'deploy:assets:precompile'
      config.should have_run('cd /foo/bar && RAILS_ENV=production RAILS_GROUPS=assets rake assets:precompile')
    end

    it 'uses bundle command' do
      mock_config { use_recipe :bundle }
      cli_execute 'deploy:assets:precompile'
      config.should have_run('cd /foo/bar && RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile')
    end

    it 'is invoked after deploy:update' do
      cli_execute 'deploy:update'
      config.should have_executed('deploy:update', 'deploy:assets:precompile')
    end
  end

  describe 'deploy:assets:clean' do
    it 'runs clean' do
      cli_execute 'deploy:assets:clean'
      config.should have_run('cd /foo/bar && RAILS_ENV=production RAILS_GROUPS=assets rake assets:clean')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
capistrano-deploy-0.3.0 spec/rails_assets_spec.rb