spec/parsers/game_parser_spec.rb in triviacrack-0.5.1 vs spec/parsers/game_parser_spec.rb in triviacrack-0.6.0
- old
+ new
@@ -4,17 +4,17 @@
describe ".parse" do
subject { TriviaCrack::Parsers::GameParser.parse raw_data }
- let(:game_data) { SpecData.get "game.json" }
- let(:dashboard_data) { SpecData.get "dashboard.json" }
- let(:answer_data) { SpecData.get "answer.json" }
- let(:new_game_data) { SpecData.get "new_game.json" }
+ let(:game_data) { SpecData.get_json "game.json" }
+ let(:dashboard_data) { SpecData.get_json "dashboard.json" }
+ let(:answer_data) { SpecData.get_json "answer.json" }
+ let(:new_game_data) { SpecData.get_json "new_game.json" }
context 'when given data from the games API' do
- let(:raw_data) { SpecData.get "game.json" }
+ let(:raw_data) { SpecData.get_json "game.json" }
it { is_expected.to be_a TriviaCrack::Game }
its(:id) { is_expected.to be 1111 }
its(:opponent) { is_expected.to be_a TriviaCrack::User }
its('opponent.id') { is_expected.to be 111 }
@@ -35,11 +35,11 @@
its(:my_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
its(:opponent_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
end
context 'when given data from the dashboard API' do
- let(:raw_data) { SpecData.get("dashboard.json")["list"][3] }
+ let(:raw_data) { SpecData.get_json("dashboard.json")["list"][3] }
it { is_expected.to be_a TriviaCrack::Game }
its(:id) { is_expected.to be 1115 }
its(:opponent) { is_expected.to be_a TriviaCrack::User }
its('opponent.id') { is_expected.to be 114 }
@@ -60,11 +60,11 @@
its(:my_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
its(:opponent_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
end
context 'when given data from the answers API' do
- let(:raw_data) { SpecData.get "answer.json" }
+ let(:raw_data) { SpecData.get_json "answer.json" }
it { is_expected.to be_a TriviaCrack::Game }
its(:id) { is_expected.to be 1111 }
its(:opponent) { is_expected.to be_a TriviaCrack::User }
its('opponent.id') { is_expected.to be 111 }
@@ -85,11 +85,11 @@
its(:my_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
its(:opponent_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
end
context 'when given data from the new game API' do
- let(:raw_data) { SpecData.get "new_game.json" }
+ let(:raw_data) { SpecData.get_json "new_game.json" }
it { is_expected.to be_a TriviaCrack::Game }
its(:id) { is_expected.to be 2222 }
its(:opponent) { is_expected.to be_a TriviaCrack::User }
its('opponent.id') { is_expected.to be 0 }
@@ -110,10 +110,10 @@
its(:my_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
its(:opponent_statistics) { is_expected.to be_a TriviaCrack::GameStatistics }
end
context 'when given data from the games API and the game is a duel' do
- let(:raw_data) { SpecData.get "game_duel.json" }
+ let(:raw_data) { SpecData.get_json "game_duel.json" }
it { is_expected.to be_a TriviaCrack::Game }
its(:id) { is_expected.to be 1119 }
its(:opponent) { is_expected.to be_a TriviaCrack::User }
its('opponent.id') { is_expected.to be 321 }