Skip to content

Commit

Permalink
Adding test to Sprint controller
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Roberto <[email protected]>
  • Loading branch information
Matheus456 committed Nov 21, 2017
1 parent fdf53b3 commit 4af0525
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/controllers/sprints_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,40 @@ def setup
release_id: @another_release.id
)

@project_without_score = Project.create(
name: "Falko",
description: "Some project description.",
user_id: @user.id,
is_project_from_github: true,
is_scoring: false
)

@release_without_score = Release.create(
name: "R1",
description: "Description",
initial_date: "01/01/2017",
final_date: "01/01/2020",
amount_of_sprints: "20",
project_id: @project_without_score.id
)

@sprint_without_score = Sprint.create(
name: "Sprint 1",
description: "Sprint 1 us10",
initial_date: "01/01/2017",
final_date: "08/01/2017",
release_id: @release_without_score.id
)

@story_without_score = Story.create(
name: "Story 1",
description: "Story 1 us14",
assign: "Lucas",
pipeline: "In progress",
initial_date: "01/01/2017",
sprint_id: @sprint_without_score.id
)

@another_token = AuthenticateUser.call(@another_user.email, @another_user.password)
end

Expand Down Expand Up @@ -294,6 +328,12 @@ def setup
assert_response :success
end

test "Should not get Burndown data if project is not scored" do
get "/sprints/#{@sprint_without_score.id}/burndown", headers: { Authorization: @token.result }

assert_response :unprocessable_entity
end

test "should not create a sprint with a final date outside the release interval" do
post "/releases/#{@release.id}/sprints", params: {
"sprint": {
Expand Down

0 comments on commit 4af0525

Please sign in to comment.