Skip to content

Commit

Permalink
page/screen: allow no name
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Sep 10, 2015
1 parent 8ca2101 commit ce95502
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
1 change: 0 additions & 1 deletion lib/segment/analytics/client.rb
Expand Up @@ -254,7 +254,6 @@ def screen(attrs)
timestamp = attrs[:timestamp] || Time.new
context = attrs[:context] || {}

fail ArgumentError, '.name must be a string' if name.empty?
fail ArgumentError, '.properties must be a hash' unless properties.is_a? Hash
isoify_dates! properties

Expand Down
4 changes: 0 additions & 4 deletions spec/segment/analytics/client_spec.rb
Expand Up @@ -223,10 +223,6 @@ class Analytics
expect { @client.screen :name => 'foo' }.to raise_error(ArgumentError)
end

it 'should error without name' do
expect { A@client.screen :user_id => 1 }.to raise_error(ArgumentError)
end

it 'should not error with the required options' do
@client.screen Queued::SCREEN
end
Expand Down
9 changes: 0 additions & 9 deletions spec/segment/analytics_spec.rb
Expand Up @@ -67,10 +67,6 @@ class Analytics
expect { analytics.page :name => 'foo' }.to raise_error(ArgumentError)
end

it 'should error without name' do
expect { analytics.page :user_id => 1 }.to raise_error(ArgumentError)
end

it 'should not error with the required options' do
analytics.page Queued::PAGE
sleep(1)
Expand All @@ -85,11 +81,6 @@ class Analytics
it 'should error without name' do
expect { analytics.screen :user_id => 1 }.to raise_error(ArgumentError)
end

it 'should not error with the required options' do
analytics.screen Queued::SCREEN
sleep(1)
end
end

describe '#flush' do
Expand Down

0 comments on commit ce95502

Please sign in to comment.