Sha256: f1c7ca1065e609dbd4bdb0150922da5785cb5c20318994b3b48b17a2127da871

Contents?: true

Size: 1.78 KB

Versions: 4

Compression:

Stored size: 1.78 KB

Contents

require 'spec_helper'

describe "Rake tasks" do

  describe "contact_us:install" do

    after(:each) do
      @destination_root = File.expand_path("../../dummy", __FILE__)
      FileUtils.rm_rf(@destination_root + "/config/initializers/contact_us.rb")
      FileUtils.rm_rf(@destination_root + "/config/locales/contact_us.en.yml")
      FileUtils.rm_rf(@destination_root + "/app/views/contact_us")
      FileUtils.rm_rf(@destination_root + "/app/views/contact_us/contact_mailer")
      FileUtils.rm_rf(@destination_root + "/app/views/contact_us/contacts")
    end

    before(:each) do
      @destination_root = File.expand_path("../../dummy", __FILE__)
      File.exists?(@destination_root + "/config/initializers/contact_us.rb").should eql(false)
      File.exists?(@destination_root + "/config/locales/contact_us.en.yml").should eql(false)
      File.directory?(@destination_root + "/app/views/contact_us").should eql(false)
      File.directory?(@destination_root + "/app/views/contact_us/contact_mailer").should eql(false)
      File.directory?(@destination_root + "/app/views/contact_us/contacts").should eql(false)

      silence_stream(STDOUT) { ContactUs::Tasks::Install.run }
    end

    it "creates initializer file" do
      File.exists?(File.join(@destination_root + "/config/initializers/contact_us.rb")).should eql(true)
    end

    it "creates locales files" do
      File.exists?(File.join(@destination_root + "/config/locales/contact_us.en.yml")).should eql(true)
    end

    it "creates view files" do
      File.directory?(@destination_root + "/app/views/contact_us").should eql(true)
      File.directory?(@destination_root + "/app/views/contact_us/contact_mailer").should eql(true)
      File.directory?(@destination_root + "/app/views/contact_us/contacts").should eql(true)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
contact_us-0.1.4 spec/lib/install_spec.rb
contact_us-0.1.3 spec/lib/install_spec.rb
contact_us-0.1.2 spec/lib/install_spec.rb
contact_us-0.1.1 spec/lib/install_spec.rb