Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move spec/models to spec/unit and add spec to rubocop
- Loading branch information
Showing
27 changed files
with
74 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule fantasy-celebrity-front-end
updated
4 files
+2 −5 | app/leagues/show/template.hbs | |
+1 −1 | app/leagues/template.hbs | |
+1 −1 | tests/unit/models/league-player-test.js | |
+1 −1 | tests/unit/models/roster-slot-test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
require 'rails_helper' | ||
require "rails_helper" | ||
|
||
RSpec.describe "Teams", :type => :request do | ||
RSpec.describe "Teams", { type: :request } do | ||
describe "SHOW" do | ||
#let(:league_template) { LeagueTemplate.find_by!({ title: "Bad Celebrity" }) } | ||
#let(:league) { League.find_by!({ title: "Sample league" }) } | ||
# let(:league_template) { LeagueTemplate.find_by!({ title: "Bad Celebrity" }) } | ||
# let(:league) { League.find_by!({ title: "Sample league" }) } | ||
let(:team) { Team.find_by!({ title: "New Team" }) } | ||
|
||
it "includes base team attributes" do | ||
get "/api/v1/teams/#{team.id}" | ||
expect(response).to be_success | ||
expect(json_body['team']['id']).to eq(team.id) | ||
expect(json_body['team']['title']).to eq(team.title) | ||
expect(json_body['team']['roster_slot_ids'].size).to eq(team.roster_slots.size) | ||
expect(json_body["team"]["id"]).to eq(team.id) | ||
expect(json_body["team"]["title"]).to eq(team.title) | ||
expect(json_body["team"]["roster_slot_ids"].size).to eq(team.roster_slots.size) | ||
end | ||
|
||
it "includes roster_slots" do | ||
get "/api/v1/teams/#{team.id}" | ||
expect(response).to be_success | ||
expect(json_body['roster_slots'].size).to eq(team.roster_slots.size) | ||
expect(json_body['roster_slots'][0]['id']).to be | ||
expect(json_body['roster_slots'][0]['league_player_id']).to be | ||
expect(json_body['roster_slots'][0]['league_position_id']).to be | ||
expect(json_body["roster_slots"].size).to eq(team.roster_slots.size) | ||
expect(json_body["roster_slots"][0]["id"]).to be | ||
expect(json_body["roster_slots"][0]["league_player_id"]).to be | ||
expect(json_body["roster_slots"][0]["league_position_id"]).to be | ||
end | ||
|
||
it "includes league_players" do | ||
get "/api/v1/teams/#{team.id}" | ||
expect(response).to be_success | ||
expect(json_body['league_players'].size).to eq(team.roster_slots.size) | ||
expect(json_body['league_players'][0]['id']).to be | ||
expect(json_body['league_players'][0]['first_name']).to be | ||
expect(json_body['league_players'][0]['last_name']).to be | ||
expect(json_body["league_players"].size).to eq(team.roster_slots.size) | ||
expect(json_body["league_players"][0]["id"]).to be | ||
expect(json_body["league_players"][0]["first_name"]).to be | ||
expect(json_body["league_players"][0]["last_name"]).to be | ||
end | ||
|
||
it "includes league_positions" do | ||
get "/api/v1/teams/#{team.id}" | ||
expect(response).to be_success | ||
expect(json_body['league_positions'].size).to eq(team.roster_slots.map(&:league_position_id).uniq.size) | ||
expect(json_body['league_positions'][0]['id']).to be | ||
expect(json_body['league_positions'][0]['title']).to be | ||
expect(json_body["league_positions"].size).to eq(team.roster_slots.map(&:league_position_id).uniq.size) | ||
expect(json_body["league_positions"][0]["id"]).to be | ||
expect(json_body["league_positions"][0]["title"]).to be | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe LeaguePlayer, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe LeaguePointCategory, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe LeaguePosition, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe LeagueTemplate, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Player, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe PointCategory, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Position, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require "rails_helper" | ||
require "roster_manager" | ||
|
||
RSpec.describe Team, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe RosterSlot, { type: :model } do | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Team, { type: :model } do | ||
end |