Sha256: 91d7eb174960dc9a2eea206f5d2e941ed3433bf41515c98ceebe32187ca34cb4

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')


describe "errors" do
  before :each do
    config_setup
    @error_report = LazyGoogleAnalytics::Client.new()
    @error_report.parameters({'ids' => "ga:#{LazyGoogleAnalytics::Config.profile_id}",
                      'start-date' => DateTime.now.prev_month.strftime("%Y-%m-%d"),
                      'end-date' => DateTime.now.strftime("%Y-%m-%d"),
                      'dimensions' => "ga:year,ga:month",
                      'metrics' => "ga:visits,ga:bounces,ga:entranceBounceRate",
                      'sort' => "ga:month,ga:day" })

  end

  it "should raise and error" do
    lambda { @error_report.results }.should raise_error
  end
end

describe "Client" do
  before(:all) do
    config_setup
    @client = LazyGoogleAnalytics::Client.new()
  end

  it "find objects object" do
    @client.results
  end

  it "headers" do
    @client.formatted_columns.should == "ga:day\tga:month\tga:visits"
  end

  it "rows" do
    @client.formatted_rows.class.should == Array
    @client.formatted_rows.should_not be_empty
  end

end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lazy_google_analytics-0.1.2 spec/functional/client_spec.rb