Sha256: 62059718f9b9308b364a429dd66f94d4c341786b8dd40d9a1059dbf6987c8072

Contents?: true

Size: 886 Bytes

Versions: 122

Compression:

Stored size: 886 Bytes

Contents

require 'helper'

describe Bearcat::Client::Analytics do
  before do
    @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
  end

  it 'returns page view data' do
    stub_get(@client, "/api/v1/accounts/1/analytics/terms/1/activity").to_return(json_response("department_level_participation.json"))
    result = @client.department_level_participation(1, 1)
    result['by_date'].count.should == 3
    result['by_category'].count.should == 13
    result['by_category'].any? {|h| h['category'] == 'assignments'}.should be_truthy
  end

  it 'returns department level statistics' do
    stub_get(@client, "/api/v1/accounts/1/analytics/terms/1/statistics").to_return(json_response("department_level_statistics.json"))
    result = @client.department_level_statistics(1, 1)
    result.count.should == 8
    result['subaccounts'].should == 8
  end
end

Version data entries

122 entries across 122 versions & 1 rubygems

Version Path
bearcat-1.3.44 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.43 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.41 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.40 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.39 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.38 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.37 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.36 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.35 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.34 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.33 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.32 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.30 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.28 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.27 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.26 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.25 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.24 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.23 spec/bearcat/client/analytics_spec.rb
bearcat-1.3.22 spec/bearcat/client/analytics_spec.rb