Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Commit

Permalink
! Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
Averethel committed Sep 8, 2015
1 parent baa4bb0 commit c9ee29e
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 48 deletions.
1 change: 0 additions & 1 deletion app/controllers/api/v1/issues_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ def free
render json: @issue
end


## Updates an issue
#
# PATCH /api/v1/issues/:id
Expand Down
73 changes: 36 additions & 37 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,48 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20150908203256) do

ActiveRecord::Schema.define(version: 20_150_908_203_256) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

create_table "comments", force: :cascade do |t|
t.text "body", null: false
t.integer "issue_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "creator_id", null: false
enable_extension 'plpgsql'

create_table 'comments', force: :cascade do |t|
t.text 'body', null: false
t.integer 'issue_id', null: false
t.datetime 'created_at', null: false
t.datetime 'updated_at', null: false
t.integer 'creator_id', null: false
end

add_index "comments", ["issue_id"], name: "index_comments_on_issue_id", using: :btree

create_table "issues", force: :cascade do |t|
t.string "title", null: false
t.text "description", null: false
t.integer "priority", null: false
t.integer "status", default: 0, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "creator_id", null: false
t.integer "assignee_id"
add_index 'comments', ['issue_id'], name: 'index_comments_on_issue_id', using: :btree

create_table 'issues', force: :cascade do |t|
t.string 'title', null: false
t.text 'description', null: false
t.integer 'priority', null: false
t.integer 'status', default: 0, null: false
t.datetime 'created_at', null: false
t.datetime 'updated_at', null: false
t.integer 'creator_id', null: false
t.integer 'assignee_id'
end

add_index "issues", ["priority"], name: "index_issues_on_priority", using: :btree
add_index "issues", ["status"], name: "index_issues_on_status", using: :btree

create_table "users", force: :cascade do |t|
t.string "username", null: false
t.string "name"
t.string "surname"
t.string "password_digest", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "role", default: 0, null: false
add_index 'issues', ['priority'], name: 'index_issues_on_priority', using: :btree
add_index 'issues', ['status'], name: 'index_issues_on_status', using: :btree

create_table 'users', force: :cascade do |t|
t.string 'username', null: false
t.string 'name'
t.string 'surname'
t.string 'password_digest', null: false
t.datetime 'created_at', null: false
t.datetime 'updated_at', null: false
t.integer 'role', default: 0, null: false
end

add_index "users", ["role"], name: "index_users_on_role", using: :btree
add_index 'users', ['role'], name: 'index_users_on_role', using: :btree

add_foreign_key "comments", "issues"
add_foreign_key "comments", "users", column: "creator_id"
add_foreign_key "issues", "users", column: "assignee_id"
add_foreign_key "issues", "users", column: "creator_id"
add_foreign_key 'comments', 'issues'
add_foreign_key 'comments', 'users', column: 'creator_id'
add_foreign_key 'issues', 'users', column: 'assignee_id'
add_foreign_key 'issues', 'users', column: 'creator_id'
end
2 changes: 1 addition & 1 deletion spec/controllers/api/v1/comments_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
end

context 'when authorized' do
let(:user){ comment.creator }
let(:user) { comment.creator }

before do
allow_any_instance_of(ApplicationController)
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/api/v1/issues_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
let!(:issue) { FactoryGirl.create(:issue) }

context 'when authorized' do
let(:user){ FactoryGirl.create(:user) }
let(:user) { FactoryGirl.create(:user) }

before do
allow_any_instance_of(ApplicationController)
Expand Down Expand Up @@ -102,7 +102,7 @@
end

context 'when authorized' do
let(:user){ issue.creator }
let(:user) { issue.creator }

before do
allow_any_instance_of(ApplicationController)
Expand Down
2 changes: 1 addition & 1 deletion spec/policies/comment_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe CommentPolicy do
subject { described_class.new(user, comment) }
let(:issue) { FactoryGirl.create(:issue) }
let(:comment) { FactoryGirl.create(:comment, issue: issue, creator: creator)}
let(:comment) { FactoryGirl.create(:comment, issue: issue, creator: creator) }

context 'with guest' do
let(:user) { FactoryGirl.build(:guest) }
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'spec_helper'
require 'rspec/rails'
Dir[Rails.root.join("spec/matchers/**/*.rb")].each {|f| require f}
Dir[Rails.root.join('spec/matchers/**/*.rb')].each { |f| require f }
# Add additional requires below this line. Rails is not loaded until this point!

# Requires supporting ruby files with custom matchers and macros, etc, in
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/api/v1/comments/destroy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe 'Comments', type: :request do
describe 'DELETE /api/v1/comments/1' do
let!(:comment) { FactoryGirl.create(:comment) }
let!(:admin) {FactoryGirl.create(:admin, username: 'test', password: 'test') }
let!(:admin) { FactoryGirl.create(:admin, username: 'test', password: 'test') }

before do
env = { 'HTTP_AUTHORIZATION': ActionController::HttpAuthentication::Basic.encode_credentials('test', 'test') }
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/api/v1/comments/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe 'PATCH /api/v1/comments/1' do
let(:comment) { FactoryGirl.create(:comment) }
let(:body) { JSON.parse(response.body) }
let!(:admin) {FactoryGirl.create(:admin, username: 'test', password: 'test') }
let!(:admin) { FactoryGirl.create(:admin, username: 'test', password: 'test') }

before do
env = { 'HTTP_AUTHORIZATION': ActionController::HttpAuthentication::Basic.encode_credentials('test', 'test') }
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/api/v1/issues/destroy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe 'Issues', type: :request do
describe 'DELETE /api/v1/issues/1' do
let!(:issue) { FactoryGirl.create(:issue) }
let!(:admin) {FactoryGirl.create(:admin, username: 'test', password: 'test') }
let!(:admin) { FactoryGirl.create(:admin, username: 'test', password: 'test') }

before do
env = { 'HTTP_AUTHORIZATION': ActionController::HttpAuthentication::Basic.encode_credentials('test', 'test') }
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/api/v1/users/destroy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RSpec.describe 'Users', type: :request do
describe 'DELETE /api/v1/users/1' do
let!(:user) { FactoryGirl.create(:user) }
let!(:admin) {FactoryGirl.create(:admin, username: 'test', password: 'test') }
let!(:admin) { FactoryGirl.create(:admin, username: 'test', password: 'test') }

before do
env = { 'HTTP_AUTHORIZATION': ActionController::HttpAuthentication::Basic.encode_credentials('test', 'test') }
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/api/v1/users/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
describe 'PATCH /api/v1/users/1' do
let(:user) { FactoryGirl.create(:user) }
let(:body) { JSON.parse(response.body) }
let!(:admin) {FactoryGirl.create(:admin, username: 'test', password: 'test') }
let!(:admin) { FactoryGirl.create(:admin, username: 'test', password: 'test') }

before do
env = { 'HTTP_AUTHORIZATION': ActionController::HttpAuthentication::Basic.encode_credentials('test', 'test') }
Expand Down

0 comments on commit c9ee29e

Please sign in to comment.