Sha256: 1ff33fe04bc0acd5832998c725d8525aea06d1a16e5d69e25b6ecac959e29c16

Contents?: true

Size: 1018 Bytes

Versions: 11

Compression:

Stored size: 1018 Bytes

Contents

require 'spec_helper'
require 'fileutils'

# Dummy Rails.root to tmp/
TMP_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'tmp'))
Rails = Class.new do
  def self.root
    TMP_DIR
  end
end

def verbose # silence the tasks
  false
end

require 'rake'
load(File.join(Ajax.root, 'tasks', 'ajax_tasks.rake'))

context 'task' do
  before :each do
    FileUtils.rm_r(TMP_DIR) if File.exists?(TMP_DIR)
    FileUtils.mkdir(TMP_DIR)
  end

  it "rails root should be tmp/" do
    Rails.root.should == TMP_DIR
  end

  context 'install' do
    it "should install files" do
      Rake::Task['ajax:install'].invoke
      INSTALL_FILES.each do |file|
        file_should_exist(File.join(Rails.root, file))
      end
    end
  end

  context 'update' do
    context 'javascript' do
      it "should update files" do
        Rake::Task['ajax:update:javascript'].invoke
        UPDATE_JAVASCRIPT_FILES.each do |file|
          file_should_exist(File.join(Rails.root, file))
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ajax-1.0.8 spec/ajax/tasks_spec.rb
ajax-1.0.7 spec/ajax/tasks_spec.rb
ajax-1.0.6 spec/ajax/tasks_spec.rb
ajax-1.0.5 spec/ajax/tasks_spec.rb
ajax-1.0.4 spec/ajax/tasks_spec.rb
ajax-1.0.3 spec/ajax/tasks_spec.rb
ajax-1.0.2 spec/ajax/tasks_spec.rb
ajax-1.0.1 spec/ajax/tasks_spec.rb
ajax-0.1.7 spec/ajax/tasks_spec.rb
ajax-0.1.6 spec/ajax/tasks_spec.rb
ajax-0.1.5 spec/ajax/tasks_spec.rb