fixes spacing
This commit is contained in:
@@ -16,6 +16,7 @@ class AccountController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def set_account
|
def set_account
|
||||||
@account = current_user
|
@account = current_user
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ class CommentsController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def comment_params
|
def comment_params
|
||||||
params.require(:comments).permit(:commentable_type, :commentable_id, :body)
|
params.require(:comments).permit(:commentable_type, :commentable_id, :body)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class DebatesController < ApplicationController
|
|||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def debate_params
|
def debate_params
|
||||||
params.require(:debate).permit(:title, :description, :tag_list, :terms_of_service, :captcha, :captcha_key)
|
params.require(:debate).permit(:title, :description, :tag_list, :terms_of_service, :captcha, :captcha_key)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ feature 'Comments' do
|
|||||||
click_button 'Publish reply'
|
click_button 'Publish reply'
|
||||||
end
|
end
|
||||||
|
|
||||||
within "#comment-#{comment.id}" do
|
within("#comment-#{comment.id}") do
|
||||||
expect(page).to have_content 'It will be done next week.'
|
expect(page).to have_content 'It will be done next week.'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ feature 'Debates' do
|
|||||||
|
|
||||||
visit new_debate_path
|
visit new_debate_path
|
||||||
click_button 'Create Debate'
|
click_button 'Create Debate'
|
||||||
expect(page).to have_content /error/
|
expect(page).to have_content error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'JS injection is prevented but safe html is respected' do
|
scenario 'JS injection is prevented but safe html is respected' do
|
||||||
@@ -183,7 +183,7 @@ feature 'Debates' do
|
|||||||
|
|
||||||
scenario 'Update should not be posible if debate is not editable' do
|
scenario 'Update should not be posible if debate is not editable' do
|
||||||
debate = create(:debate)
|
debate = create(:debate)
|
||||||
vote = create(:vote, votable: debate)
|
create(:vote, votable: debate)
|
||||||
expect(debate).to_not be_editable
|
expect(debate).to_not be_editable
|
||||||
login_as(debate.author)
|
login_as(debate.author)
|
||||||
|
|
||||||
@@ -264,12 +264,9 @@ feature 'Debates' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe 'Limiting tags shown' do
|
describe 'Limiting tags shown' do
|
||||||
let(:all_tags) {
|
tags = ["Hacienda", "Economía", "Medio Ambiente", "Corrupción", "Fiestas populares", "Prensa", "Huelgas"]
|
||||||
["Hacienda", "Economía", "Medio Ambiente", "Corrupción", "Fiestas populares", "Prensa", "Huelgas"]
|
let(:all_tags) { tags }
|
||||||
}
|
let(:debate) { create :debate, tag_list: all_tags }
|
||||||
let(:debate) {
|
|
||||||
create :debate, tag_list: all_tags
|
|
||||||
}
|
|
||||||
|
|
||||||
scenario 'Index page shows up to 5 tags per debate' do
|
scenario 'Index page shows up to 5 tags per debate' do
|
||||||
debate
|
debate
|
||||||
@@ -287,7 +284,7 @@ feature 'Debates' do
|
|||||||
|
|
||||||
scenario 'Index page shows 3 tags with no plus link' do
|
scenario 'Index page shows 3 tags with no plus link' do
|
||||||
tag_list = ["Medio Ambiente", "Corrupción", "Fiestas populares"]
|
tag_list = ["Medio Ambiente", "Corrupción", "Fiestas populares"]
|
||||||
debate = create :debate, tag_list: tag_list
|
create :debate, tag_list: tag_list
|
||||||
|
|
||||||
visit debates_path
|
visit debates_path
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ feature 'Users' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Sign in' do
|
scenario 'Sign in' do
|
||||||
user = create(:user, email: 'manuela@madrid.es', password: 'judgementday')
|
create(:user, email: 'manuela@madrid.es', password: 'judgementday')
|
||||||
|
|
||||||
visit '/'
|
visit '/'
|
||||||
click_link 'Log in'
|
click_link 'Log in'
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ feature 'Votes' do
|
|||||||
debate1 = create(:debate)
|
debate1 = create(:debate)
|
||||||
debate2 = create(:debate)
|
debate2 = create(:debate)
|
||||||
debate3 = create(:debate)
|
debate3 = create(:debate)
|
||||||
vote = create(:vote, voter: @manuela, votable: debate1, vote_flag: true)
|
create(:vote, voter: @manuela, votable: debate1, vote_flag: true)
|
||||||
vote = create(:vote, voter: @manuela, votable: debate3, vote_flag: false)
|
create(:vote, voter: @manuela, votable: debate3, vote_flag: false)
|
||||||
|
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
@@ -65,8 +65,8 @@ feature 'Votes' do
|
|||||||
debate1 = create(:debate)
|
debate1 = create(:debate)
|
||||||
debate2 = create(:debate)
|
debate2 = create(:debate)
|
||||||
debate3 = create(:debate)
|
debate3 = create(:debate)
|
||||||
vote = create(:vote, voter: @manuela, votable: debate1, vote_flag: true)
|
create(:vote, voter: @manuela, votable: debate1, vote_flag: true)
|
||||||
vote = create(:vote, voter: @manuela, votable: debate3, vote_flag: false)
|
create(:vote, voter: @manuela, votable: debate3, vote_flag: false)
|
||||||
|
|
||||||
visit debates_path
|
visit debates_path
|
||||||
|
|
||||||
@@ -128,8 +128,8 @@ feature 'Votes' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Show' do
|
scenario 'Show' do
|
||||||
vote = create(:vote, voter: @manuela, votable: @debate, vote_flag: true)
|
create(:vote, voter: @manuela, votable: @debate, vote_flag: true)
|
||||||
vote = create(:vote, voter: @pablo, votable: @debate, vote_flag: false)
|
create(:vote, voter: @pablo, votable: @debate, vote_flag: false)
|
||||||
|
|
||||||
visit debate_path(@debate)
|
visit debate_path(@debate)
|
||||||
|
|
||||||
@@ -250,8 +250,8 @@ feature 'Votes' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Show' do
|
scenario 'Show' do
|
||||||
vote = create(:vote, voter: @manuela, votable: @comment, vote_flag: true)
|
create(:vote, voter: @manuela, votable: @comment, vote_flag: true)
|
||||||
vote = create(:vote, voter: @pablo, votable: @comment, vote_flag: false)
|
create(:vote, voter: @pablo, votable: @comment, vote_flag: false)
|
||||||
|
|
||||||
visit debate_path(@debate)
|
visit debate_path(@debate)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user