New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
completed games mvc #2
Conversation
…ctions for each model, created the profile page, specified views for visitors/players/DM
spec/factories/users.rb
Outdated
sequence(:username) { |n| 'testuser{n}' } | ||
sequence(:email) { |n| 'test{n}@test.com' } | ||
sequence(:username) { |n| 'testuser#{n}' } | ||
sequence(:email) { |n| 'test#{n}@test.com' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused block argument - n. You can omit the argument if you don't care about it.
spec/factories/users.rb
Outdated
@@ -1,7 +1,7 @@ | |||
FactoryGirl.define do | |||
factory :user do | |||
sequence(:username) { |n| 'testuser{n}' } | |||
sequence(:email) { |n| 'test{n}@test.com' } | |||
sequence(:username) { |n| 'testuser#{n}' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused block argument - n. You can omit the argument if you don't care about it.
spec/factories/games.rb
Outdated
@@ -1,6 +1,6 @@ | |||
FactoryGirl.define do | |||
factory :game do | |||
sequence(:name) { |n| 'testgame{n}' } | |||
sequence(:name) { |n| 'testgame#{n}' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused block argument - n. You can omit the argument if you don't care about it.
flash[:notice] = "#{@signup.user.username} has been added to #{@signup.game.name}" | ||
redirect_to game_path(@game) | ||
else | ||
flash[:notice] = 'Error. Please make sure the username is spelled correctly, including capitalization' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [108/80]
@signup = Signup.create(user: @user, game: @game) | ||
Request.where(user: @user, game: @game).delete_all | ||
if @signup.save | ||
flash[:notice] = "#{@signup.user.username} has been added to #{@signup.game.name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [88/80]
private | ||
|
||
def comment_params | ||
params.require(:comment).permit ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use parentheses around a literal.
@@ -0,0 +1,25 @@ | |||
class CommentsController < ApplicationController | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line detected at class body beginning.
document.getElementById('div1').style.display='none'; | ||
if (document.getElementById('writecomment') != null) { | ||
document.getElementById('writecomment').style.display='block' | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary semicolon.
function hidefield() { | ||
document.getElementById('div1').style.display='none'; | ||
if (document.getElementById('writecomment') != null) { | ||
document.getElementById('writecomment').style.display='block' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
|
||
function hidefield() { | ||
document.getElementById('div1').style.display='none'; | ||
if (document.getElementById('writecomment') != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use '!==' to compare with 'null'.
@@ -1,13 +1,17 @@ | |||
require 'rails_helper' | |||
|
|||
describe GamesController, type: :controller do | |||
include Devise::Test::ControllerHelpers | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
Added games views, buttons for all models, completed necessary CRUD actions for each model, created the profile page, specified views for visitors/players/DM