Sha256: 87bf557b80f758d515b1d32aa81b0a20297003ab573d647e5978e89f11b6b143

Contents?: true

Size: 1017 Bytes

Versions: 8

Compression:

Stored size: 1017 Bytes

Contents

require File.dirname(__FILE__) + "/integration_helper"

describe Locomotive::Builder do
  it "imports" do
    File.exists?("site/config/site.yml").should be_false
    clone_site
    YAML.load_file("site/config/site.yml").should == {
      "name"=>"locomotive",
      "locales"=>["en", "es"],
      "subdomain"=>"locomotive",
      "domains"=>["locomotive.engine.dev"]
    }
  end
  
  it "pushes" do
    clone_site
    file_name = File.dirname(__FILE__) + '/../../site/app/views/pages/index.liquid'
    text = File.read(file_name)
    text.gsub!(/Content of the home page/, "New content of the home page")
    File.open(file_name, "w") { |file| file.puts text}
    VCR.use_cassette('push') do
      Locomotive::Builder.push("site", {"host" => "locomotive.engine.dev:3000"}, "email" => "admin@locomotivecms.com", "password" => "locomotive")
    end
    
    WebMock.should have_requested(:put, /pages\/.+.json\?auth_token=.+/).with(:body => /page\[raw_template\]=New%20content%20of%20the%20home%20page/).once
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
locomotivecms_builder-1.0.0.alpha8 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha7 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha6 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha5 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha4 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha3 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha2 spec/integration/sites_spec.rb
locomotivecms_builder-1.0.0.alpha1 spec/integration/sites_spec.rb