Sha256: 00fb68f4cf908759c286fcc94b7c6086d6c21c1a6e67cc845df6f8ccf8156ab7

Contents?: true

Size: 546 Bytes

Versions: 6

Compression:

Stored size: 546 Bytes

Contents

require 'spec_helper'

describe AbPanel::Javascript do
  it 'returns json of all relevant properties, funnels and experiments' do
    AbPanel.set_env('distinct_id', 'distinct_id')
    AbPanel.set_env(:properties, { post_name: 'test' })
    result = JSON.parse(AbPanel::Javascript.environment)
    result['distinct_id'].should == 'distinct_id'
  end

  it 'works without extra properties' do
    AbPanel.set_env(:properties, nil)
    result = JSON.parse(AbPanel::Javascript.environment)
    result['distinct_id'].should == 'distinct_id'
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ab_panel-0.3.3 spec/ab_panel/javascript_spec.rb
ab_panel-0.3.2 spec/ab_panel/javascript_spec.rb
ab_panel-0.3.1 spec/ab_panel/javascript_spec.rb
ab_panel-0.3.0 spec/ab_panel/javascript_spec.rb
ab_panel-0.2.0 spec/ab_panel/javascript_spec.rb
ab_panel-0.1.3 spec/ab_panel/javascript_spec.rb