Skip to content

Commit 675024f

Browse files
authored
Merging pull request #94 from fga-gpp-mds/issue_91
2 parents fe4b00f + ae5c4a5 commit 675024f

16 files changed

+32
-32
lines changed

app/controllers/projects_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ def set_project
8080
end
8181

8282
def project_params
83-
params.require(:project).permit(:name, :description, :check_project, :user_id)
83+
params.require(:project).permit(:name, :description, :is_project_from_github, :user_id)
8484
end
8585
end

app/models/project.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ class Project < ApplicationRecord
44

55
validates :name, presence: true, length: { maximum: 128, minimum: 2 }
66
validates :description, length: { maximum: 256 }
7-
validates :check_project, inclusion: { in: [true, false] }
7+
validates :is_project_from_github, inclusion: { in: [true, false] }
88
end

db/migrate/20171030030726_add_check_project_to_projects.rb

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class AddIsProjectFromGithubToProjects < ActiveRecord::Migration[5.1]
2+
def change
3+
add_column :projects, :is_project_from_github, :boolean
4+
end
5+
end

db/schema.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema.define(version: 20171105003057) do
13+
ActiveRecord::Schema.define(version: 20171107172605) do
1414

1515
# These are extensions that must be enabled in order to support this database
1616
enable_extension "plpgsql"
@@ -21,7 +21,7 @@
2121
t.datetime "created_at", null: false
2222
t.datetime "updated_at", null: false
2323
t.bigint "user_id"
24-
t.boolean "check_project"
24+
t.boolean "is_project_from_github"
2525
t.index ["user_id"], name: "index_projects_on_user_id"
2626
end
2727

db/seeds.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
name: "Owla",
3333
description: "This project helps improving classes",
3434
user_id: "1",
35-
check_project: true
35+
is_project_from_github: true
3636
),
3737
Project.find_or_create_by(
3838
name: "Falko",
3939
description: "Agile Projects Manager",
4040
user_id: "2",
41-
check_project: true
41+
is_project_from_github: true
4242
)
4343
]
4444

test/controllers/projects_controller_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ def setup
1414
"name": "Falko",
1515
"description": "Some project description 1.",
1616
"user_id": @user.id,
17-
"check_project": true
17+
"is_project_from_github": true
1818
)
1919

2020
@project2 = Project.create(
2121
"name": "Falko",
2222
"description": "Some project description 2.",
2323
"user_id": @user.id,
24-
"check_project": false
24+
"is_project_from_github": false
2525
)
2626

2727
@token = AuthenticateUser.call(@user.email, @user.password)
@@ -33,7 +33,7 @@ def setup
3333
"name": "Falko",
3434
"description": "Some project description.",
3535
"user_id": @user.id,
36-
"check_project": true
36+
"is_project_from_github": true
3737
}
3838
}, headers: { Authorization: @token.result }
3939

@@ -47,7 +47,7 @@ def setup
4747
"project": {
4848
"name": "",
4949
"description": "A" * 260,
50-
"check_project": true
50+
"is_project_from_github": true
5151
}
5252
}, headers: { Authorization: @token.result }
5353

@@ -69,7 +69,7 @@ def setup
6969
project: {
7070
"name": "Falko BackEnd",
7171
"description": "Falko BackEnd!",
72-
"check_project": "true"
72+
"is_project_from_github": "true"
7373
}
7474
}, headers: { Authorization: @token.result }
7575
@project.reload
@@ -87,7 +87,7 @@ def setup
8787
project: {
8888
"name": "a",
8989
"description": "a",
90-
"check_project": "false"
90+
"is_project_from_github": "false"
9191
}
9292
}, headers: { Authorization: @token.result }
9393
@project.reload
@@ -221,7 +221,7 @@ def mock.organization_repositories(login)
221221
end
222222
end
223223

224-
test "should not import a project from github if the check_project is invalid" do
224+
test "should not import a project from github if the is_project_from_github is invalid" do
225225
post "/users/#{@user.id}/projects", params: {
226226
"project": {
227227
"name": "Falko",

test/controllers/releases_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup
1414
name: "Falko",
1515
description: "Description.",
1616
user_id: @user.id,
17-
check_project: true
17+
is_project_from_github: true
1818
)
1919

2020
@release = Release.create(
@@ -39,7 +39,7 @@ def setup
3939
name: "Futebol",
4040
description: "Description.",
4141
user_id: @user.id,
42-
check_project: true
42+
is_project_from_github: true
4343
)
4444

4545
@another_release = Release.create(

test/controllers/retrospectives_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def setup
1313
@project = Project.create(
1414
name: "Falko",
1515
description: "A Project.",
16-
check_project: true,
16+
is_project_from_github: true,
1717
user_id: @user.id
1818
)
1919

@@ -63,7 +63,7 @@ def setup
6363
@another_project = Project.create(
6464
name: "Falko",
6565
description: "Project Description.",
66-
check_project: true,
66+
is_project_from_github: true,
6767
user_id: @another_user.id
6868
)
6969

test/controllers/sprints_controller_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def setup
1414
name: "Falko",
1515
description: "Some project description.",
1616
user_id: @user.id,
17-
check_project: true
17+
is_project_from_github: true
1818
)
1919

2020
@release = Release.create(
@@ -48,7 +48,7 @@ def setup
4848
name: "Falko 2",
4949
description: "Some project description 2.",
5050
user_id: @another_user.id,
51-
check_project: true
51+
is_project_from_github: true
5252
)
5353

5454
@another_release = Release.create(

0 commit comments

Comments
 (0)