- <%= link_to "Astuto", root_path, class: "navbar-brand" %>
+ <%= link_to 'Astuto', root_path, class: 'navbar-brand' %>
- <%= render "layouts/boards_menu_section", boards: @boards unless @boards.nil? %>
+ <%= render 'layouts/boards_menu_section', boards: @boards unless @boards.nil? %>
<% if user_signed_in? %>
<% if current_user.moderator? || current_user.admin? %>
-
- <%= link_to "Admin Panel", admin_root_path, class: "nav-link", 'data-turbolinks': 'false' %>
+ <%= link_to 'Admin Panel', admin_root_path, class: 'nav-link', 'data-turbolinks': 'false' %>
<% end %>
-
- <%= image_tag(current_user.gravatar_url, class: "gravatar", alt: current_user.full_name, size: 24) %>
+ <%= image_tag(current_user.gravatar_url, class: 'gravatar', alt: current_user.full_name, size: 24) %>
<%= current_user.full_name %>
<% else %>
-
- <%= link_to "Sign in / Sign up", new_user_session_path, class: "nav-link" %>
+ <%= link_to 'Sign in / Sign up', new_user_session_path, class: 'nav-link' %>
<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index cb795356..d3150376 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -10,8 +10,8 @@
- <%= render "layouts/header" %>
- <%= render "layouts/alerts" %>
+ <%= render 'layouts/header' %>
+ <%= render 'layouts/alerts' %>
<%= yield %>
diff --git a/config/routes.rb b/config/routes.rb
index f9c77e1f..6c276afd 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -2,7 +2,7 @@ Rails.application.routes.draw do
root to: 'static_pages#home'
namespace :admin do
- root to: "boards#index"
+ root to: 'boards#index'
resources :boards
resources :post_statuses
diff --git a/spec/factories/boards.rb b/spec/factories/boards.rb
index 4a29d395..f5282239 100644
--- a/spec/factories/boards.rb
+++ b/spec/factories/boards.rb
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :board do
sequence(:name) { |n| "Board#{n}" }
- description { "My fantastic board" }
+ description { 'My fantastic board' }
end
end
diff --git a/spec/factories/post_statuses.rb b/spec/factories/post_statuses.rb
index 209dc666..409d017f 100644
--- a/spec/factories/post_statuses.rb
+++ b/spec/factories/post_statuses.rb
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :post_status do
sequence(:name) { |n| "Post Status #{n}" }
- color { "#ffffff" }
+ color { '#ffffff' }
end
end
diff --git a/spec/factories/posts.rb b/spec/factories/posts.rb
index 89b39e4b..354e1efc 100644
--- a/spec/factories/posts.rb
+++ b/spec/factories/posts.rb
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :post do
- title { "Post Title" }
- description { "Post Description" }
+ title { 'Post Title' }
+ description { 'Post Description' }
board
user
post_status
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
index f1dde099..a47f4030 100644
--- a/spec/factories/users.rb
+++ b/spec/factories/users.rb
@@ -2,23 +2,23 @@ FactoryBot.define do
factory :user do
sequence(:email) { |n| "user#{n}@example.com" }
- full_name { "First Last" }
- password { "password" }
+ full_name { 'First Last' }
+ password { 'password' }
end
factory :moderator, class: User do
sequence(:email) { |n| "mod#{n}@example.com" }
- full_name { "First Last" }
- password { "password" }
- role { "moderator" }
+ full_name { 'First Last' }
+ password { 'password' }
+ role { 'moderator' }
end
factory :admin, class: User do
sequence(:email) { |n| "admin#{n}@example.com" }
- full_name { "First Last" }
- password { "password" }
- role { "admin" }
+ full_name { 'First Last' }
+ password { 'password' }
+ role { 'admin' }
end
end
diff --git a/spec/models/board_spec.rb b/spec/models/board_spec.rb
index c6493a02..a06a35e1 100644
--- a/spec/models/board_spec.rb
+++ b/spec/models/board_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe Board, type: :model do
it 'has a non-nil and non-empty name' do
nil_name_board = FactoryBot.build(:board, name: nil)
- empty_name_board = FactoryBot.build(:board, name: "")
+ empty_name_board = FactoryBot.build(:board, name: '')
expect(nil_name_board).to be_invalid
expect(empty_name_board).to be_invalid
@@ -24,7 +24,7 @@ RSpec.describe Board, type: :model do
it 'has a description that can be nil or empty' do
nil_description_board = FactoryBot.build(:board, description: nil)
- empty_description_board = FactoryBot.build(:board, description: "")
+ empty_description_board = FactoryBot.build(:board, description: '')
expect(nil_description_board).to be_valid
expect(empty_description_board).to be_valid
diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb
index 21d95cd2..0eb9e75e 100644
--- a/spec/models/post_spec.rb
+++ b/spec/models/post_spec.rb
@@ -9,17 +9,17 @@ RSpec.describe Post, type: :model do
it 'has a non-nil and non-empty title' do
nil_post = FactoryBot.build(:post, title: nil)
- empty_post = FactoryBot.build(:post, title: "")
+ empty_post = FactoryBot.build(:post, title: '')
expect(nil_post).to be_invalid
expect(empty_post).to be_invalid
end
it 'has a title between 4 and 64 characters' do
- too_short_post = FactoryBot.build(:post, title: "a" * 3)
- short_post = FactoryBot.build(:post, title: "a" * 4)
- long_post = FactoryBot.build(:post, title: "a" * 64)
- too_long_post = FactoryBot.build(:post, title: "a" * 65)
+ too_short_post = FactoryBot.build(:post, title: 'a' * 3)
+ short_post = FactoryBot.build(:post, title: 'a' * 4)
+ long_post = FactoryBot.build(:post, title: 'a' * 64)
+ too_long_post = FactoryBot.build(:post, title: 'a' * 65)
expect(too_short_post).to be_invalid
expect(short_post).to be_valid
@@ -29,7 +29,7 @@ RSpec.describe Post, type: :model do
it 'has a description that can be nil or empty' do
nil_description_post = FactoryBot.build(:post, description: nil)
- empty_description_post = FactoryBot.build(:post, description: "")
+ empty_description_post = FactoryBot.build(:post, description: '')
expect(nil_description_post).to be_valid
expect(empty_description_post).to be_valid
diff --git a/spec/models/post_status_spec.rb b/spec/models/post_status_spec.rb
index 19c30fd6..48e798e7 100644
--- a/spec/models/post_status_spec.rb
+++ b/spec/models/post_status_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe PostStatus, type: :model do
end
it 'must have a name' do
- empty_name = FactoryBot.build(:post_status, name: "")
+ empty_name = FactoryBot.build(:post_status, name: '')
nil_name = FactoryBot.build(:post_status, name: nil)
expect(empty_name).to be_invalid
@@ -23,11 +23,11 @@ RSpec.describe PostStatus, type: :model do
it 'has a valid hex color' do
nil_color = FactoryBot.build(:post_status, color: nil)
- empty_color = FactoryBot.build(:post_status, color: "")
- invalid_color = FactoryBot.build(:post_status, color: "ffffff")
- invalid_color2 = FactoryBot.build(:post_status, color: "#ffff")
- valid_color = FactoryBot.build(:post_status, color: "#fff")
- valid_color2 = FactoryBot.build(:post_status, color: "#ffffff")
+ empty_color = FactoryBot.build(:post_status, color: '')
+ invalid_color = FactoryBot.build(:post_status, color: 'ffffff')
+ invalid_color2 = FactoryBot.build(:post_status, color: '#ffff')
+ valid_color = FactoryBot.build(:post_status, color: '#fff')
+ valid_color2 = FactoryBot.build(:post_status, color: '#ffffff')
expect(nil_color).to be_invalid
expect(empty_color).to be_invalid
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 3fe49bfc..49f9685d 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe User, type: :model do
end
it 'creates a user with role "user" by default' do
- expect(User.new.role).to eq("user")
+ expect(User.new.role).to eq('user')
end
it 'can have the following roles: "user", "moderator" and "admin"' do
@@ -16,9 +16,9 @@ RSpec.describe User, type: :model do
moderator = FactoryBot.build(:moderator)
admin = FactoryBot.build(:admin)
- expect(user.role).to eq("user")
- expect(moderator.role).to eq("moderator")
- expect(admin.role).to eq("admin")
+ expect(user.role).to eq('user')
+ expect(moderator.role).to eq('moderator')
+ expect(admin.role).to eq('admin')
expect(user).to be_valid
expect(moderator).to be_valid
@@ -27,17 +27,17 @@ RSpec.describe User, type: :model do
it 'has a non-nil and non-empty full name' do
nil_name_user = FactoryBot.build(:user, full_name: nil)
- empty_name_user = FactoryBot.build(:user, full_name: "")
+ empty_name_user = FactoryBot.build(:user, full_name: '')
expect(nil_name_user).to be_invalid
expect(empty_name_user).to be_invalid
end
it 'has a full name between 2 and 32 characters' do
- too_short_user = FactoryBot.build(:user, full_name: "a" * 1)
- short_user = FactoryBot.build(:user, full_name: "a" * 2)
- long_user = FactoryBot.build(:user, full_name: "a" * 32)
- too_long_user = FactoryBot.build(:user, full_name: "a" * 33)
+ too_short_user = FactoryBot.build(:user, full_name: 'a' * 1)
+ short_user = FactoryBot.build(:user, full_name: 'a' * 2)
+ long_user = FactoryBot.build(:user, full_name: 'a' * 32)
+ too_long_user = FactoryBot.build(:user, full_name: 'a' * 33)
expect(too_short_user).to be_invalid
expect(short_user).to be_valid
@@ -46,7 +46,7 @@ RSpec.describe User, type: :model do
end
it 'has an email that must contain a @' do
- invalid_email_user = FactoryBot.build(:user, email: "invalid.email")
+ invalid_email_user = FactoryBot.build(:user, email: 'invalid.email')
expect(invalid_email_user).to be_invalid
end