spec/parsers/profile_parser_spec.rb in triviacrack-0.6.0 vs spec/parsers/profile_parser_spec.rb in triviacrack-0.7.0

- old
+ new

@@ -1,23 +1,23 @@ -require "spec_helper" +# frozen_string_literal: true -describe TriviaCrack::Parsers::ProfileParser do +require 'spec_helper' - describe ".parse" do - +describe TriviaCrack::Parsers::ProfileParser do + describe '.parse' do subject { TriviaCrack::Parsers::ProfileParser.parse raw_data } context 'when given data from the profile API' do - let(:raw_data) { SpecData.get_json "profile.json" } + let(:raw_data) { SpecData.get_json 'profile.json' } it { is_expected.to be_a TriviaCrack::Profile } its(:id) { is_expected.to be 111 } its(:is_friend) { is_expected.to be false } its(:is_blocked) { is_expected.to be false } - its(:username) { is_expected.to eq "example" } + its(:username) { is_expected.to eq 'example' } its(:country) { is_expected.to be :us } - its(:email) { is_expected.to eq "user@example.com" } + its(:email) { is_expected.to eq 'user@example.com' } its(:last_play) { is_expected.to be_a Time } its(:last_login) { is_expected.to be_a Time } its(:games_won) { is_expected.to be 530 } its(:games_lost) { is_expected.to be 240 } its(:games_resigned) { is_expected.to be 0 } @@ -30,18 +30,18 @@ its(:my_wins_vs_user) { is_expected.to be 0 } its(:my_losses_vs_user) { is_expected.to be 1 } end context 'when given data from the current user profile API' do - let(:raw_data) { SpecData.get_json "my_profile.json" } + let(:raw_data) { SpecData.get_json 'my_profile.json' } it { is_expected.to be_a TriviaCrack::Profile } its(:id) { is_expected.to be 222 } its(:is_friend) { is_expected.to be false } its(:is_blocked) { is_expected.to be false } - its(:username) { is_expected.to eq "example2" } + its(:username) { is_expected.to eq 'example2' } its(:country) { is_expected.to be :ca } - its(:email) { is_expected.to eq "user2@example.com" } + its(:email) { is_expected.to eq 'user2@example.com' } its(:last_play) { is_expected.to be_a Time } its(:last_login) { is_expected.to be_a Time } its(:games_won) { is_expected.to be 37 } its(:games_lost) { is_expected.to be 12 } its(:games_resigned) { is_expected.to be 0 }