diff --git a/app/models/comment.rb b/app/models/comment.rb
index 3f8dd83f4..91d7447c0 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -1,10 +1,10 @@
class Comment < ActiveRecord::Base
- acts_as_nested_set :scope => [:commentable_id, :commentable_type]
+ acts_as_nested_set scope: [:commentable_id, :commentable_type]
- validates :body, :presence => true
- validates :user, :presence => true
+ validates :body, presence: true
+ validates :user, presence: true
- belongs_to :commentable, :polymorphic => true
+ belongs_to :commentable, polymorphic: true
belongs_to :user
def self.build(commentable, user, body)
diff --git a/app/views/devise/menu/_login_items.html.erb b/app/views/devise/menu/_login_items.html.erb
index 89b9ad253..0a0c85430 100644
--- a/app/views/devise/menu/_login_items.html.erb
+++ b/app/views/devise/menu/_login_items.html.erb
@@ -1,9 +1,9 @@
<% if user_signed_in? %>
- <%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
+ <%= link_to('Logout', destroy_user_session_path, method: :delete) %>
<% else %>
- <%= link_to('Login', new_user_session_path) %>
+ <%= link_to('Login', new_user_session_path) %>
<% end %>
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index a527a7ad5..4522da3d3 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,6 @@
Rails.application.routes.draw do
- devise_for :users, :controllers => { registrations: 'registrations' }
-
+ devise_for :users, controllers: { registrations: 'registrations' }
+
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".
diff --git a/db/migrate/20150717180105_acts_as_votable_migration.rb b/db/migrate/20150717180105_acts_as_votable_migration.rb
index 4bdcbe377..798dd48f9 100644
--- a/db/migrate/20150717180105_acts_as_votable_migration.rb
+++ b/db/migrate/20150717180105_acts_as_votable_migration.rb
@@ -2,8 +2,8 @@ class ActsAsVotableMigration < ActiveRecord::Migration
def self.up
create_table :votes do |t|
- t.references :votable, :polymorphic => true
- t.references :voter, :polymorphic => true
+ t.references :votable, polymorphic: true
+ t.references :voter, polymorphic: true
t.boolean :vote_flag
t.string :vote_scope
diff --git a/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb b/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb
index 728b26b9e..26edafbaf 100644
--- a/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb
+++ b/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb
@@ -1,6 +1,6 @@
class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration
def self.up
- create_table :comments, :force => true do |t|
+ create_table :comments, force: true do |t|
t.integer :commentable_id
t.string :commentable_type
t.string :title
diff --git a/spec/features/comments_spec.rb b/spec/features/comments_spec.rb
index c4b0e163b..f392003e2 100644
--- a/spec/features/comments_spec.rb
+++ b/spec/features/comments_spec.rb
@@ -10,7 +10,7 @@ feature 'Comments' do
visit debate_path(debate)
expect(page).to have_css('.comment', count: 3)
-
+
comment = Comment.first
within first('.comment') do
expect(page).to have_content comment.user.name
@@ -22,7 +22,7 @@ feature 'Comments' do
scenario 'Create' do
user = create(:user)
debate = create(:debate)
-
+
login_as(user)
visit debate_path(debate)
@@ -30,7 +30,7 @@ feature 'Comments' do
click_button 'Publicar comentario'
expect(page).to have_content 'Comentario guardado'
-
+
within "#comments" do
expect(page).to have_content '¿Has pensado en esto...?'
end
@@ -41,9 +41,9 @@ feature 'Comments' do
manuela = create(:user, first_name: 'Manuela')
debate = create(:debate)
comment = create(:comment, commentable: debate, user: citizen)
-
- visit debate_path(debate)
+
login_as(manuela)
+ visit debate_path(debate)
within "#comment-#{comment.id}" do
fill_in 'comment_body', with: 'La semana que viene está hecho.'
@@ -60,7 +60,7 @@ feature 'Comments' do
debate = create(:debate)
parent = create(:comment, commentable: debate)
- 7.times do
+ 7.times do
create(:comment, commentable: debate).
move_to_child_of(parent)
parent = parent.children.first
@@ -69,5 +69,5 @@ feature 'Comments' do
visit debate_path(debate)
expect(page).to have_css(".comment.comment.comment.comment.comment.comment.comment.comment")
end
-
+
end
\ No newline at end of file