From f475583729084f4065635d07c8923c38ef5f1ae4 Mon Sep 17 00:00:00 2001 From: Washington Botelho Date: Thu, 16 Jan 2020 14:15:38 -0300 Subject: [PATCH] spec: update --- spec/models/extension/unscoped_rating_spec.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/models/extension/unscoped_rating_spec.rb b/spec/models/extension/unscoped_rating_spec.rb index 10d9913..ed49b25 100644 --- a/spec/models/extension/unscoped_rating_spec.rb +++ b/spec/models/extension/unscoped_rating_spec.rb @@ -5,6 +5,7 @@ require 'rails_helper' RSpec.describe Rating::Extension, 'unscoped_rating' do let!(:author_1) { create :author } let!(:author_2) { create :author } + let!(:author_3) { create :author } let!(:scope) { create :category } context 'when is false' do @@ -13,7 +14,7 @@ RSpec.describe Rating::Extension, 'unscoped_rating' do it 'groups in different line record' do author_1.rate resource, 1, scope: scope author_2.rate resource, 2, scope: scope - author_1.rate resource, 5 + author_2.rate resource, 5 ratings = Rating::Rating.all.order('id') @@ -45,7 +46,7 @@ RSpec.describe Rating::Extension, 'unscoped_rating' do it 'groups in the same line record' do author_1.rate resource, 1, scope: scope author_2.rate resource, 2, scope: scope - author_1.rate resource, 5 + author_2.rate resource, 5 ratings = Rating::Rating.all.order('id') @@ -62,15 +63,15 @@ RSpec.describe Rating::Extension, 'unscoped_rating' do end end - context 'when is true and have a non scopeable record first on database' do + context 'when is true and have a non scoped record first on database' do let!(:resource) { create :global } before { ::Rating::Rating.create resource: resource, scopeable: scope } - it 'groups in the line with no scope' do + it 'sets the result on record with no scope' do author_1.rate resource, 1, scope: scope author_2.rate resource, 2, scope: scope - author_1.rate resource, 5 + author_3.rate resource, 5 ratings = Rating::Rating.all.order('id')