Merge branch 'master' of github.com:locomotivecms/engine

This commit is contained in:
Didier Lafforgue 2012-05-24 19:19:57 +02:00
commit c58075b7c3
7 changed files with 30 additions and 15 deletions

View File

@ -36,6 +36,7 @@ group :test do
# gem 'growl-glue' # gem 'growl-glue'
gem 'cucumber-rails', :require => false gem 'cucumber-rails', :require => false
gem 'poltergeist'
gem 'rspec-rails', '~> 2.8.0' gem 'rspec-rails', '~> 2.8.0'
gem 'shoulda-matchers' gem 'shoulda-matchers'
@ -50,4 +51,4 @@ group :test do
gem 'json_spec' gem 'json_spec'
gem 'database_cleaner' gem 'database_cleaner'
end end

View File

@ -147,6 +147,7 @@ GEM
rack rack
ejs (1.0.0) ejs (1.0.0)
erubis (2.7.0) erubis (2.7.0)
eventmachine (0.12.10)
excon (0.13.4) excon (0.13.4)
execjs (1.4.0) execjs (1.4.0)
multi_json (~> 1.0) multi_json (~> 1.0)
@ -155,6 +156,8 @@ GEM
factory_girl_rails (1.6.0) factory_girl_rails (1.6.0)
factory_girl (~> 2.5.0) factory_girl (~> 2.5.0)
railties (>= 3.0.0) railties (>= 3.0.0)
faye-websocket (0.4.5)
eventmachine (>= 0.12.0)
ffi (1.0.11) ffi (1.0.11)
flash_cookie_session (1.1.3) flash_cookie_session (1.1.3)
rails (~> 3.0) rails (~> 3.0)
@ -177,6 +180,7 @@ GEM
haml (3.1.6) haml (3.1.6)
highline (1.6.12) highline (1.6.12)
hike (1.2.1) hike (1.2.1)
http_parser.rb (0.5.3)
httparty (0.8.3) httparty (0.8.3)
multi_json (~> 1.0) multi_json (~> 1.0)
multi_xml multi_xml
@ -230,6 +234,12 @@ GEM
pickle (0.4.10) pickle (0.4.10)
cucumber (>= 0.8) cucumber (>= 0.8)
rake rake
poltergeist (0.6.0)
capybara (~> 1.0)
childprocess (~> 0.3)
faye-websocket (~> 0.4, >= 0.4.4)
http_parser.rb (~> 0.5.3)
multi_json (~> 1.0)
polyglot (0.3.3) polyglot (0.3.3)
rack (1.4.1) rack (1.4.1)
rack-cache (1.2) rack-cache (1.2)
@ -336,6 +346,7 @@ DEPENDENCIES
locomotive_cms! locomotive_cms!
mocha (= 0.9.12) mocha (= 0.9.12)
pickle pickle
poltergeist
rspec-cells rspec-cells
rspec-rails (~> 2.8.0) rspec-rails (~> 2.8.0)
sass-rails (~> 3.2.4) sass-rails (~> 3.2.4)

View File

@ -55,6 +55,7 @@ Locomotive CMS is an open source project, we encourage contributions. If you hav
* Install ruby and mongoDB * Install ruby and mongoDB
* Clone the project <code>git clone git@github.com:locomotivecms/engine.git</code> * Clone the project <code>git clone git@github.com:locomotivecms/engine.git</code>
* Setup a virtual host entry for <code>test.example.com</code> to point to localhost * Setup a virtual host entry for <code>test.example.com</code> to point to localhost
* Install PhantomJS (Required for the cucumber suite See: https://github.com/jonleighton/poltergeist)
* Run the tests <code>rake</code> * Run the tests <code>rake</code>
* Write your failing tests * Write your failing tests
* Make the tests pass * Make the tests pass

View File

@ -57,15 +57,16 @@ class Locomotive.Views.CurrentSite.EditView extends Locomotive.Views.Shared.Form
@$('#site_memberships_input').append(@memberships_view.render().el) @$('#site_memberships_input').append(@memberships_view.render().el)
enable_liquid_editing: -> enable_liquid_editing: ->
input = @$('#site_robots_txt') if($('#site_robots_txt').length)
@editor = CodeMirror.fromTextArea input.get()[0], input = @$('#site_robots_txt')
mode: 'liquid' @editor = CodeMirror.fromTextArea input.get()[0],
autoMatchParens: false mode: 'liquid'
lineNumbers: false autoMatchParens: false
passDelay: 50 lineNumbers: false
tabMode: 'shift' passDelay: 50
theme: 'default' tabMode: 'shift'
onChange: (editor) => @model.set(robots_txt: editor.getValue()) theme: 'default'
onChange: (editor) => @model.set(robots_txt: editor.getValue())
save: (event) -> save: (event) ->
if @model.includes_domain(window.location.host) if @model.includes_domain(window.location.host)

View File

@ -11,14 +11,14 @@ xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do
if page.templatized? if page.templatized?
page.content_type.entries.visible.each do |c| page.content_type.entries.visible.each do |c|
xml.url do xml.url do
xml.loc page_url(page, { :content => c, :host => true }) xml.loc page_url(page, { :content => c })
xml.lastmod c.updated_at.to_date.to_s('%Y-%m-%d') xml.lastmod c.updated_at.to_date.to_s('%Y-%m-%d')
xml.priority 0.9 xml.priority 0.9
end end
end end
else else
xml.url do xml.url do
xml.loc page_url(page, { :host => true }) xml.loc page_url(page)
xml.lastmod page.updated_at.to_date.to_s('%Y-%m-%d') xml.lastmod page.updated_at.to_date.to_s('%Y-%m-%d')
xml.priority 0.9 xml.priority 0.9
end end

View File

@ -43,8 +43,8 @@ end
# try to render a page by slug # try to render a page by slug
When /^I view the rendered page at "([^"]*)"$/ do |path| When /^I view the rendered page at "([^"]*)"$/ do |path|
# If we're running selenium then we need to use a different port # If we're running poltergeist then we need to use a different port
if Capybara.current_driver == :selenium if Capybara.current_driver == :poltergeist
visit "http://#{@site.domains.first}:#{Capybara.server_port}#{path}" visit "http://#{@site.domains.first}:#{Capybara.server_port}#{path}"
else else
visit "http://#{@site.domains.first}#{path}" visit "http://#{@site.domains.first}#{path}"

View File

@ -18,6 +18,7 @@ require 'capybara'
require 'capybara/rails' require 'capybara/rails'
require 'capybara/cucumber' require 'capybara/cucumber'
require 'capybara/session' require 'capybara/session'
require 'capybara/poltergeist'
require 'json_spec/cucumber' require 'json_spec/cucumber'
@ -44,7 +45,7 @@ end
Capybara.default_wait_time = 5 Capybara.default_wait_time = 5
# Capybara.javascript_driver = :rack_test Capybara.javascript_driver = :poltergeist
# Stop endless errors like # Stop endless errors like
# ~/.rvm/gems/ruby-1.9.2-p0@global/gems/rack-1.2.1/lib/rack/utils.rb:16: # ~/.rvm/gems/ruby-1.9.2-p0@global/gems/rack-1.2.1/lib/rack/utils.rb:16: