Skip to content
Snippets Groups Projects
Commit e0ff8a88 authored by Eduardo Machado's avatar Eduardo Machado
Browse files

97: statistic tests fixed

parent 6738137e
No related branches found
No related tags found
No related merge requests found
...@@ -2,10 +2,17 @@ require 'acceptance_helpers' ...@@ -2,10 +2,17 @@ require 'acceptance_helpers'
require 'shared/contexts' require 'shared/contexts'
resource 'Statistics' do resource 'Statistics' do
before { 12.times { create(:learning_object) } }
before { 12.times { create(:learning_object); create(:user) } } let(:learning_objects) { LearningObject.all }
let(:ip) { Faker::Internet.ip_v4_address }
get '/v1/statistics' do get '/v1/statistics' do
before do
create(:download, user: @user, downloadable: learning_objects.first)
end
example 'Showing plataform statistics' do example 'Showing plataform statistics' do
do_request do_request
expect(status).to eq(200) expect(status).to eq(200)
......
FactoryGirl.define do
factory :download do
downloadable
ip { Faker::Internet.ip_v4_address }
user
end
end
FactoryGirl.define do FactoryGirl.define do
factory :learning_object, aliases: [:complainable, :reviewable, :stageable, :subjectable, :likeable, :collectionable, :bookmarkable] do factory :learning_object, aliases: [:complainable, :downloadable, :reviewable, :stageable, :subjectable, :likeable, :collectionable, :bookmarkable] do
sequence(:name) { |i| "LearningObject #{i}" } sequence(:name) { |i| "LearningObject #{i}" }
sequence(:id_dspace) { |i| i } sequence(:id_dspace) { |i| i }
publisher publisher
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment