Skip to content
This repository
Browse code

added travis-ci config and modified code to work on ruby 1.8.7

  • Loading branch information...
commit e995e899a075be9f568f88968d8611615505a0a4 1 parent 7cad814
Jean-Philippe Boily authored April 21, 2012

Showing 32 changed files with 113 additions and 80 deletions. Show diff stats Hide diff stats

  1. 13  .travis.yml
  2. 5  Gemfile
  3. 10  app/controllers/monologue/admin/posts_controller.rb
  4. 6  app/controllers/monologue/posts_controller.rb
  5. 14  app/form_builders/monologue_admin_form_builder.rb
  6. 6  app/models/monologue/post.rb
  7. 12  app/models/monologue/posts_revision.rb
  8. 2  app/views/layouts/monologue/admin.html.erb
  9. 2  app/views/layouts/monologue/admin/_nav_bar.html.erb
  10. 12  app/views/monologue/admin/posts/_form.html.erb
  11. 4  app/views/monologue/admin/posts/edit.html.erb
  12. 4  app/views/monologue/admin/posts/index.html.erb
  13. 2  app/views/monologue/admin/posts/new.html.erb
  14. 2  app/views/monologue/admin/sessions/new.html.erb
  15. 4  app/views/monologue/posts/_pagination.html.erb
  16. 4  app/views/monologue/posts/index.html.erb
  17. 2  app/views/monologue/posts/show.html.erb
  18. 12  config/routes.rb
  19. 2  db/migrate/20120120193858_create_monologue_posts_revisions.rb
  20. 2  db/seeds.rb
  21. 15  spec/dummy/config/database-travis.yml
  22. 2  spec/dummy/config/database.yml
  23. 8  spec/factories/monologue_posts_and_revisions.rb
  24. 2  spec/factories/monologue_users.rb
  25. 4  spec/models/monologue/post_spec.rb
  26. 2  spec/models/monologue/posts_revision_spec.rb
  27. 26  spec/requests/admin/posts_spec.rb
  28. 4  spec/requests/admin/sessions_spec.rb
  29. 2  spec/requests/cache_spec.rb
  30. 2  spec/requests/pagination_spec.rb
  31. 2  spec/requests/preview_spec.rb
  32. 4  spec/support/login_helpers.rb
13  .travis.yml
... ...
@@ -0,0 +1,13 @@
  1
+language: ruby
  2
+before_script: 
  3
+  - export DISPLAY=:99.0
  4
+  - sh -e /etc/init.d/xvfb start
  5
+  - mv spec/dummy/config/database-travis.yml spec/dummy/config/database.yml
  6
+  - bundle exec rake db:create db:migrate
  7
+rvm:
  8
+  - 1.8.7
  9
+  - 1.9.2
  10
+  - 1.9.3
  11
+env:
  12
+  - DB=mysql DB_USERNAME=root
  13
+  - DB=postgresql DB_USERNAME=postgres
5  Gemfile
@@ -20,4 +20,9 @@ gem "jquery-rails"
20 20
 group :development do 
21 21
   gem "thin"
22 22
   gem 'rails', '3.2.3'
  23
+
  24
+  if RUBY_PLATFORM.downcase.include?("darwin")
  25
+    gem 'rb-fsevent'
  26
+    gem 'growl'
  27
+  end
23 28
 end
10  app/controllers/monologue/admin/posts_controller.rb
... ...
@@ -1,6 +1,6 @@
1 1
 class Monologue::Admin::PostsController < Monologue::Admin::BaseController
2 2
   respond_to :html
3  
-  cache_sweeper Monologue::PostsSweeper, only: [:create, :update, :destroy]
  3
+  cache_sweeper Monologue::PostsSweeper, :only => [:create, :update, :destroy]
4 4
   
5 5
   def index
6 6
     @posts = Monologue::Post.includes(:posts_revisions).joins(:posts_revisions).order("published_at DESC").all
@@ -20,7 +20,7 @@ def create
20 20
     @revision.user_id = current_user.id
21 21
  
22 22
     if @post.save
23  
-      redirect_to edit_admin_post_path(@post), notice: 'Monologue created'
  23
+      redirect_to edit_admin_post_path(@post), :notice =>  'Monologue created'
24 24
     else
25 25
       render :action => "new"
26 26
     end
@@ -37,7 +37,7 @@ def update
37 37
     @revision = @post.posts_revisions.build(params[:post][:posts_revision])
38 38
     @revision.user_id = current_user.id
39 39
     if @post.save
40  
-      redirect_to edit_admin_post_path(@post), notice: 'Monologue saved'
  40
+      redirect_to edit_admin_post_path(@post), :notice =>  'Monologue saved'
41 41
     else
42 42
       render :edit
43 43
     end
@@ -46,9 +46,9 @@ def update
46 46
   def destroy
47 47
     post = Monologue::Post.find(params[:id])
48 48
     if post.destroy
49  
-      redirect_to admin_posts_path, notice: "Monologue removed"
  49
+      redirect_to admin_posts_path, :notice =>  "Monologue removed"
50 50
     else
51  
-      redirect_to admin_posts_path, alert: "Failed to remove monologue!"
  51
+      redirect_to admin_posts_path, :alert => "Failed to remove monologue!"
52 52
     end
53 53
   end
54 54
 end
6  app/controllers/monologue/posts_controller.rb
... ...
@@ -1,5 +1,5 @@
1 1
 class Monologue::PostsController < Monologue::ApplicationController
2  
-  caches_page :index, :show, :feed , if: Proc.new { current_user.nil? }
  2
+  caches_page :index, :show, :feed , :if => Proc.new { current_user.nil? }
3 3
 
4 4
   def index
5 5
     @page = params[:page].nil? ? 1 : params[:page]
@@ -8,9 +8,9 @@ def index
8 8
   
9 9
   def show
10 10
     unless current_user
11  
-      post = Monologue::Post.published.where("monologue_posts_revisions.url = :url", {url: root_path + params[:post_url]}).first
  11
+      post = Monologue::Post.published.where("monologue_posts_revisions.url = :url", {:url => root_path + params[:post_url]}).first
12 12
     else
13  
-      post = Monologue::Post.default.where("monologue_posts_revisions.url = :url", {url: root_path + params[:post_url]}).first
  13
+      post = Monologue::Post.default.where("monologue_posts_revisions.url = :url", {:url => root_path + params[:post_url]}).first
14 14
     end
15 15
     if post.nil?
16 16
       not_found
14  app/form_builders/monologue_admin_form_builder.rb
... ...
@@ -1,9 +1,9 @@
1 1
 class MonologueAdminFormBuilder < ActionView::Helpers::FormBuilder
2  
-  delegate :content_tag, :tag, to: :@template
  2
+  delegate :content_tag, :tag, :to => :@template
3 3
   
4 4
   %w[text_field text_area password_field collection_select select file_field].each do |method_name|
5 5
     define_method(method_name) do |name, *args|
6  
-      content_tag :div, class: "field" do
  6
+      content_tag :div, :class =>  "field" do
7 7
         field_label(name, *args) + super(name, *args)
8 8
       end
9 9
     end
@@ -12,24 +12,24 @@ class MonologueAdminFormBuilder < ActionView::Helpers::FormBuilder
12 12
   def check_box(name, *args)
13 13
     options = args.extract_options!
14 14
     required = object.class.validators_on(name).any? { |v| v.kind_of? ActiveModel::Validations::PresenceValidator }
15  
-    content_tag :label, class: (required ? "required checkbox inline" : "checkbox inline") do
  15
+    content_tag :label, :class =>  (required ? "required checkbox inline" : "checkbox inline") do
16 16
       super + (options[:label] || name)
17 17
     end
18 18
   end
19 19
 
20 20
   def collection_check_boxes(attribute, records, record_id, record_name)
21  
-    content_tag :div, class: "field" do
  21
+    content_tag :div, :class =>  "field" do
22 22
       @template.hidden_field_tag("#{object_name}[#{attribute}][]") +
23 23
       records.map do |record|
24 24
         element_id = "#{object_name}_#{attribute}_#{record.send(record_id)}"
25  
-        checkbox = @template.check_box_tag("#{object_name}[#{attribute}][]", record.send(record_id),  object.send(attribute).include?(record.send(record_id)), id: element_id)
  25
+        checkbox = @template.check_box_tag("#{object_name}[#{attribute}][]", record.send(record_id),  object.send(attribute).include?(record.send(record_id)), :id => element_id)
26 26
         checkbox + " " + @template.label_tag(element_id, record.send(record_name))
27 27
       end.join(tag(:br)).html_safe
28 28
     end
29 29
   end
30 30
 
31 31
   def submit(*args)
32  
-    content_tag :div, class: "actions" do
  32
+    content_tag :div, :class =>  "actions" do
33 33
       super
34 34
     end
35 35
   end
@@ -52,7 +52,7 @@ def error_messages
52 52
     def field_label(name, *args)
53 53
       options = args.extract_options!
54 54
       required = object.class.validators_on(name).any? { |v| v.kind_of? ActiveModel::Validations::PresenceValidator }
55  
-      label(name, options[:label], class: ("required" if required))
  55
+      label(name, options[:label], :class =>  ("required" if required))
56 56
     end
57 57
 
58 58
     def objectify_options(options)
6  app/models/monologue/post.rb
... ...
@@ -1,6 +1,6 @@
1 1
 module Monologue
2 2
   class Post < ActiveRecord::Base
3  
-    has_many :posts_revisions, dependent: :destroy
  3
+    has_many :posts_revisions, :dependent => :destroy
4 4
 
5 5
     accepts_nested_attributes_for :posts_revisions
6 6
     attr_accessible :posts_revisions_attributes
@@ -9,9 +9,9 @@ class Post < ActiveRecord::Base
9 9
     
10 10
     
11 11
     scope :default, includes(:posts_revisions).where("posts_revision_id = monologue_posts_revisions.id").order("published_at DESC")
12  
-    scope :published, default.where(published: true)
  12
+    scope :published, default.where(:published => true)
13 13
 
14  
-    validates :posts_revision_id, uniqueness: true
  14
+    validates :posts_revision_id, :uniqueness => true
15 15
 
16 16
     def just_the_revision_one_before
17 17
       self.posts_revisions.where("post_id = ?", self.id).order("monologue_posts_revisions.updated_at DESC").offset(1).limit(1).first
12  app/models/monologue/posts_revision.rb
@@ -10,12 +10,12 @@ class PostsRevision < ActiveRecord::Base
10 10
     belongs_to :post
11 11
     belongs_to :user
12 12
     
13  
-    validates :title, presence: true
14  
-    validates :content, presence: true
15  
-    validates :url, presence: true
16  
-    validates :user_id, presence: true
17  
-#    validates :post_id, presence: true # TODO: do something about this validation on the first creation of a POST
18  
-    validates :published_at, presence: true
  13
+    validates :title, :presence =>  true
  14
+    validates :content, :presence =>  true
  15
+    validates :url, :presence =>  true
  16
+    validates :user_id, :presence =>  true
  17
+#    validates :post_id, :presence =>  true # TODO: do something about this validation on the first creation of a POST
  18
+    validates :published_at, :presence =>  true
19 19
     
20 20
     def latest_revision_is_current
21 21
       post = Monologue::Post.find(self.post_id)
2  app/views/layouts/monologue/admin.html.erb
@@ -12,7 +12,7 @@
12 12
   <% end %>
13 13
   <div class="container">
14 14
     <% flash.each do |name, msg| %>
15  
-      <%= content_tag :div, msg, id: "flash_#{name}", class: (name == :notice ? "alert alert-info" : "alert alert-error") %>
  15
+      <%= content_tag :div, msg, :id => "flash_#{name}", :class => (name == :notice ? "alert alert-info" : "alert alert-error") %>
16 16
     <% end %>
17 17
 
18 18
     <%= yield %>
2  app/views/layouts/monologue/admin/_nav_bar.html.erb
... ...
@@ -1,7 +1,7 @@
1 1
 <div class="navbar">
2 2
   <div class="navbar-inner">
3 3
     <div class="container">
4  
-      <%= link_to "Monologue", admin_path, class: "brand" %>
  4
+      <%= link_to "Monologue", admin_path, :class => "brand" %>
5 5
       <ul class="nav pull-left">
6 6
 
7 7
         <li class="<%= request.fullpath === new_admin_post_path ? "active":"" %>">
12  app/views/monologue/admin/posts/_form.html.erb
... ...
@@ -1,13 +1,13 @@
1 1
 <%= post.error_messages %>
2 2
 <%= post.fields_for @revision do |revision| %>
3  
-  <%= revision.text_field :title, label: t(".title"), class: "span6" %>
4  
-  <%= revision.text_area :content, label: t(".content"), class: "span12 ckeditor" %>
5  
-  <%= revision.text_field :url, label: raw(t(".url")) %>
6  
-  <%= revision.text_field :published_at, label: t(".published_at"), data: {datepicker:"datepicker"}, value: revision.object.published_at.nil? ? "" : revision.object.published_at.strftime("%Y-%m-%d") %>
  3
+  <%= revision.text_field :title, :label =>  t(".title"), :class =>  "span6" %>
  4
+  <%= revision.text_area :content, :label =>  t(".content"), :class =>  "span12 ckeditor" %>
  5
+  <%= revision.text_field :url, :label =>  raw(t(".url")) %>
  6
+  <%= revision.text_field :published_at, :label =>  t(".published_at"), :data => {:datepicker => "datepicker"}, :value => revision.object.published_at.nil? ? "" : revision.object.published_at.strftime("%Y-%m-%d") %>
7 7
 <% end %>
8  
-<%= post.check_box :published, label: t(".published") %>
  8
+<%= post.check_box :published, :label =>  t(".published") %>
9 9
 
10  
-<%= post.submit t(".save"), class: "btn btn-large btn-primary" %> <a href="<%= @revision.url %>" target="_blank" class="btn btn-large"><%= t(".preview") %></a>
  10
+<%= post.submit t(".save"), :class =>  "btn btn-large btn-primary" %> <a href="<%= @revision.url %>" target="_blank" class="btn btn-large"><%= t(".preview") %></a>
11 11
 
12 12
 <script>
13 13
   if($.fn.datepicker.defaults_<%= I18n.locale %>){
4  app/views/monologue/admin/posts/edit.html.erb
... ...
@@ -1,4 +1,4 @@
1 1
 <h1><%= t(".header") %> "<%= @post.posts_revisions.last.title %>"</h1>
2  
-<%= monologue_admin_form_for ["admin", @post], method: :put do |post| %>
3  
-  <%= render partial: 'form', locals: {post: post} %>
  2
+<%= monologue_admin_form_for ["admin", @post], :method => :put do |post| %>
  3
+  <%= render :partial => 'form', :locals => {:post => post} %>
4 4
 <% end %>
4  app/views/monologue/admin/posts/index.html.erb
@@ -10,8 +10,8 @@
10 10
     <% @posts.each do |post|%>
11 11
       <tr>
12 12
         <td><%= link_to post.posts_revisions.last.title, edit_admin_post_path(post) %></td>
13  
-        <td><%= link_to t(".edit"), edit_admin_post_path(post), class: "btn btn-small" %></td>
14  
-        <td><%= link_to t(".delete"), ["admin", post], confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-danger" %></td>
  13
+        <td><%= link_to t(".edit"), edit_admin_post_path(post), :class => "btn btn-small" %></td>
  14
+        <td><%= link_to t(".delete"), ["admin", post], :confirm => 'Are you sure?', :method => :delete, :class => "btn btn-small btn-danger" %></td>
15 15
       </tr>
16 16
     <% end %>
17 17
   </tbody>
2  app/views/monologue/admin/posts/new.html.erb
... ...
@@ -1,4 +1,4 @@
1 1
 <h1><%= t(".header") %></h1>
2 2
 <%= monologue_admin_form_for ["admin", @post] do |post| %>
3  
-  <%= render partial: 'form', locals: {post: post} %>
  3
+  <%= render :partial => 'form', :locals => {:post => post} %>
4 4
 <% end %>
2  app/views/monologue/admin/sessions/new.html.erb
@@ -9,5 +9,5 @@
9 9
     <%= label_tag :password, t(".password") %>
10 10
     <%= password_field_tag :password %>
11 11
   </div>
12  
-  <div class="actions"><%= submit_tag t(".button"), class: "btn btn-large btn-primary" %></div>
  12
+  <div class="actions"><%= submit_tag t(".button"), :class => "btn btn-large btn-primary" %></div>
13 13
 <% end %>
4  app/views/monologue/posts/_pagination.html.erb
... ...
@@ -1,9 +1,9 @@
1 1
 <div id="pagination">
2 2
   <% if @posts.total_pages > 1 && @posts.total_pages != @page.to_i %>
3  
-    <%= link_to t(".older_posts"), posts_page_path(@page.to_i+1), class: "older_posts" %>
  3
+    <%= link_to t(".older_posts"), posts_page_path(@page.to_i+1), :class => "older_posts" %>
4 4
   <% end %>
5 5
 
6 6
   <% if @posts.total_pages > 1 && @page.to_i > 1 %>
7  
-    <%= link_to t(".newer_posts"), posts_page_path(@page.to_i-1), class: "newer_posts" %>
  7
+    <%= link_to t(".newer_posts"), posts_page_path(@page.to_i-1), :class => "newer_posts" %>
8 8
   <% end %>
9 9
 </div>
4  app/views/monologue/posts/index.html.erb
@@ -9,9 +9,9 @@
9 9
       </time>&nbsp;&nbsp;|&nbsp;&nbsp;<%= revision.user.name %>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<%= revision.url + "#disqus_thread" %>"></a>
10 10
     </header>
11 11
     
12  
-    <p><%= raw truncate(strip_tags(revision.content), length: 1000) %></p>
  12
+    <p><%= raw truncate(strip_tags(revision.content), :length => 1000) %></p>
13 13
     
14  
-    <%= link_to t(".readmore"), revision.url, class: "btn alignleft" %>
  14
+    <%= link_to t(".readmore"), revision.url, :class => "btn alignleft" %>
15 15
   </section>
16 16
 <% end %>
17 17
 
2  app/views/monologue/posts/show.html.erb
@@ -4,7 +4,7 @@
4 4
 <% end %>
5 5
 
6 6
 <% content_for :meta_description do %>
7  
-  <%= truncate(strip_tags(@revision.content), length: 155) %>
  7
+  <%= truncate(strip_tags(@revision.content), :length => 155) %>
8 8
 <% end %>
9 9
 
10 10
 <article>
12  config/routes.rb
... ...
@@ -1,15 +1,15 @@
1 1
 Monologue::Engine.routes.draw do
2  
-  root to: "posts#index"
3  
-  match "/page/:page", to: "posts#index", as: "posts_page"
4  
-  match "/feed" => "posts#feed", as: "feed", defaults: {format: :rss}
  2
+  root :to =>  "posts#index"
  3
+  match "/page/:page", :to =>  "posts#index", :as =>  "posts_page"
  4
+  match "/feed" => "posts#feed", :as =>  "feed", :defaults => {:format => :rss}
5 5
   
6  
-  namespace :admin, path: "monologue" do
7  
-    get "/" => "posts#index", as: "" # responds to admin_url and admin_path
  6
+  namespace :admin, :path => "monologue" do
  7
+    get "/" => "posts#index", :as =>  "" # responds to admin_url and admin_path
8 8
     get "logout" => "sessions#destroy"
9 9
     get "login" => "sessions#new"
10 10
     resources :sessions
11 11
     resources :posts
12 12
   end
13 13
   
14  
-  match "*post_url" => "posts#show", as: "post"
  14
+  match "*post_url" => "posts#show", :as =>  "post"
15 15
 end
2  db/migrate/20120120193858_create_monologue_posts_revisions.rb
@@ -11,7 +11,7 @@ def change
11 11
       t.timestamps
12 12
     end
13 13
     
14  
-    add_index :monologue_posts_revisions, :id, unique: true
  14
+    add_index :monologue_posts_revisions, :id, :unique => true
15 15
     add_index :monologue_posts_revisions, :published_at
16 16
     add_index :monologue_posts_revisions, :post_id    
17 17
   end
2  db/seeds.rb
... ...
@@ -1 +1 @@
1  
-Monologue::User.create!({name: "Monologue", email: "monologue@example.com", password: "monologue", password_confirmation: "monologue"})
  1
+Monologue::User.create!({:name => "Monologue", :email => "monologue@example.com", :password => "monologue", :password_confirmation => "monologue"})
15  spec/dummy/config/database-travis.yml
... ...
@@ -0,0 +1,15 @@
  1
+development:
  2
+  adapter: mysql2
  3
+  encoding: utf8
  4
+  reconnect: false
  5
+  database: monologue_development
  6
+  pool: 5
  7
+  username: root
  8
+
  9
+test:
  10
+  adapter: mysql2
  11
+  encoding: utf8
  12
+  reconnect: false
  13
+  database: monologue_test
  14
+  pool: 5
  15
+  username: root
2  spec/dummy/config/database.yml
@@ -22,4 +22,4 @@ production:
22 22
   adapter: sqlite3
23 23
   database: db/production.sqlite3
24 24
   pool: 5
25  
-  timeout: 5000
  25
+  timeout: 5000
8  spec/factories/monologue_posts_and_revisions.rb
... ...
@@ -1,10 +1,10 @@
1 1
 # encoding: UTF-8
2 2
 FactoryGirl.define do
3  
-  factory :post, class: Monologue::Post do
  3
+  factory :post, :class =>  Monologue::Post do
4 4
     published true
5 5
   end
6 6
   
7  
-  factory :posts_revision, class: Monologue::PostsRevision do
  7
+  factory :posts_revision, :class =>  Monologue::PostsRevision do
8 8
     sequence(:title) {|i| "post #{i} | revision 1"}
9 9
     content "this is some text with french accents éàöûù and so on...even html tags like <br />"
10 10
     sequence(:url) { |i| "/monologue/post/#{i}" }
@@ -13,12 +13,12 @@
13 13
     sequence(:published_at) {|i| DateTime.new(2012,1,1,12,0,17) + i.days }
14 14
   end
15 15
 
16  
-  factory :unpublished_post, class: Monologue::Post, :parent => :post do |post|
  16
+  factory :unpublished_post, :class =>  Monologue::Post, :parent => :post do |post|
17 17
     published false
18 18
     post.after_create { |p| Factory(:posts_revision, :post => p, :title => "unpublished", :url => "/monologue/unpublished") }
19 19
   end
20 20
 
21  
-  factory :post_with_multiple_revisions, class: Monologue::Post, :parent => :post do |post|
  21
+  factory :post_with_multiple_revisions, :class =>  Monologue::Post, :parent => :post do |post|
22 22
     post.after_create { |p| Factory(:posts_revision, :post => p, :title => "post X | revision 1", :url => "/monologue/post/x") }
23 23
     post.after_create { |p| Factory(:posts_revision, :post => p, :title => "post X | revision 2", :url => "/monologue/post/x") }
24 24
   end
2  spec/factories/monologue_users.rb
... ...
@@ -1,7 +1,7 @@
1 1
 # Read about factories at http://github.com/thoughtbot/factory_girl
2 2
 
3 3
 FactoryGirl.define do
4  
-  factory :user, class: Monologue::User do
  4
+  factory :user, :class => Monologue::User do
5 5
     name "John Doe"
6 6
     email "jdoe@example.com"
7 7
     password "secret"
4  spec/models/monologue/post_spec.rb
@@ -11,8 +11,8 @@
11 11
     
12 12
   describe "validations" do    
13 13
     it "is not possible to have twice the same posts_revision_id" do
14  
-      Factory(:post, posts_revision_id: 1)
15  
-      expect { Factory(:post, posts_revision_id: 1) }.to raise_error(ActiveRecord::RecordInvalid)
  14
+      Factory(:post, :posts_revision_id => 1)
  15
+      expect { Factory(:post, :posts_revision_id => 1) }.to raise_error(ActiveRecord::RecordInvalid)
16 16
     end
17 17
   end
18 18
 end
2  spec/models/monologue/posts_revision_spec.rb
@@ -24,7 +24,7 @@
24 24
 
25 25
   it "should create permalink (url) automaticly with title and year if none is provided" do
26 26
     title = "this is a great title!!!"
27  
-    post = Factory(:posts_revision, url:"", title:title, published_at: "2012-02-02")
  27
+    post = Factory(:posts_revision, :url => "", :title => title, :published_at => "2012-02-02")
28 28
     post.url.should == "/2012/this-is-a-great-title"
29 29
   end
30 30
 
26  spec/requests/admin/posts_spec.rb
@@ -14,10 +14,10 @@
14 14
     it "can create new post" do
15 15
       visit new_admin_post_path
16 16
       page.should have_content "New monologue"
17  
-      fill_in "Title", with: "This is a monologue"
18  
-      fill_in "Content", with: "C'est l'histoire d'un gars comprends tu...and finally it has some french accents àèùöûç...meh!"
19  
-      fill_in "URL", with: "/2012/this-is-a-monologue"
20  
-      fill_in "Published at", with: DateTime.now
  17
+      fill_in "Title", :with =>  "my title"
  18
+      fill_in "Content", :with =>  "C'est l'histoire d'un gars comprends tu...and finally it has some french accents àèùöûç...meh!"
  19
+      fill_in "URL", :with =>  "/2012/this-is-a-monologue"
  20
+      fill_in "Published at", :with =>  DateTime.now
21 21
       click_button "Save"
22 22
       page.should have_content "Monologue created"
23 23
     end
@@ -26,19 +26,19 @@
26 26
       # TODO: remove this duplicated code. Should be a working factory
27 27
         visit new_admin_post_path
28 28
         page.should have_content "New monologue"
29  
-        fill_in "Title", with: "my title"
30  
-        fill_in "Content", with: "C'est l'histoire d'un gars comprends tu...and finally it has some french accents àèùöûç...meh!"
31  
-        fill_in "URL", with: "/2012/this-is-a-monologue"
32  
-        fill_in "Published at", with: DateTime.now
  29
+        fill_in "Title", :with =>  "my title"
  30
+        fill_in "Content", :with =>  "C'est l'histoire d'un gars comprends tu...and finally it has some french accents àèùöûç...meh!"
  31
+        fill_in "URL", :with =>  "/2012/this-is-a-monologue"
  32
+        fill_in "Published at", :with =>  DateTime.now
33 33
         click_button "Save"
34 34
       # / TODO
35 35
       visit admin_posts_path
36 36
       click_on "my title"
37 37
       page.should have_content "Edit \""
38  
-      fill_in "Title", with: "This is a new title"
39  
-      fill_in "Content", with: "New content here..."
40  
-      fill_in "URL", with: "/new-title-and-url"
41  
-      fill_in "Published at", with: DateTime.now
  38
+      fill_in "Title", :with =>  "This is a new title"
  39
+      fill_in "Content", :with =>  "New content here..."
  40
+      fill_in "URL", :with =>  "/new-title-and-url"
  41
+      fill_in "Published at", :with =>  DateTime.now
42 42
       nbr_posts_revisions = Monologue::PostsRevision.all.count
43 43
       click_button "Save"
44 44
       (nbr_posts_revisions + 1).should equal(Monologue::PostsRevision.all.count)
@@ -68,7 +68,7 @@
68 68
     
69 69
     it "can NOT edit posts" do
70 70
       post = Factory(:post)
71  
-      pr = Factory(:posts_revision, post_id: post.id)
  71
+      pr = Factory(:posts_revision, :post_id => post.id)
72 72
 #      , posts_revisions: [Factory(:posts_revision)])
73 73
       visit edit_admin_post_path(pr)
74 74
       page.should have_content "You must first log in"
4  spec/requests/admin/sessions_spec.rb
@@ -19,8 +19,8 @@
19 19
     it "won't log if bad credentials are provided" do
20 20
       user = Factory(:user)
21 21
       visit admin_login_path
22  
-      fill_in "email", with: user.email
23  
-      fill_in "Password", with: "whatever"
  22
+      fill_in "email", :with =>  user.email
  23
+      fill_in "Password", :with =>  "whatever"
24 24
       click_button "Log in"
25 25
       page.should have_content("Invalid email or password")
26 26
     end
2  spec/requests/cache_spec.rb
@@ -5,7 +5,7 @@
5 5
     @post_1 = Factory(:posts_revision).post
6 6
     @post_2 = Factory(:posts_revision).post
7 7
     @post_3 = Factory(:posts_revision).post
8  
-    25.times { |i| Factory(:posts_revision, title: "post #{i}", url: "/monologue/post/#{i}") }
  8
+    25.times { |i| Factory(:posts_revision, :title => "post #{i}", :url => "/monologue/post/#{i}") }
9 9
     ActionController::Base.perform_caching = true # TODO: make that work. This does not seem to work flawlessly, so it's set in dummy's config/environments/test.rb too...
10 10
     clear_cache
11 11
   end
2  spec/requests/pagination_spec.rb
@@ -2,7 +2,7 @@
2 2
 require 'spec_helper'
3 3
 describe "pagination" do
4 4
   before(:each) do
5  
-    41.times { |i| Factory(:posts_revision, title: "post #{i}") }
  5
+    41.times { |i| Factory(:posts_revision, :title => "post #{i}") }
6 6
     @posts_per_page = Monologue.posts_per_page
7 7
   end
8 8
 
2  spec/requests/preview_spec.rb
@@ -3,7 +3,7 @@
3 3
   before(:each) do
4 4
     @post_path = "/monologue/post/1"
5 5
     @post_title = "post 1 | revision 1"
6  
-    Factory(:posts_revision, title: @post_title, url: @post_path)
  6
+    Factory(:posts_revision, :title => @post_title, :url => @post_path)
7 7
     ActionController::Base.perform_caching = true
8 8
     clear_cache
9 9
   end
4  spec/support/login_helpers.rb
@@ -3,8 +3,8 @@ module LoginHelpers
3 3
   def log_in
4 4
     user = Factory(:user)
5 5
     visit admin_login_path
6  
-    fill_in "email", with: user.email
7  
-    fill_in "Password", with: user.password
  6
+    fill_in "email", :with =>  user.email
  7
+    fill_in "Password", :with =>  user.password
8 8
     click_button "Log in"
9 9
     page.should have_content("Logged in!")
10 10
   end

0 notes on commit e995e89

Please sign in to comment.
Something went wrong with that request. Please try again.