Commit c487bddc155ebce56b8cc07290def02a05141564

Authored by Nathan Broadbent
1 parent 8e43c55d
Exists in master and in 1 other branch production

Fixed user agent string specs

spec/models/notice_spec.rb
... ... @@ -51,7 +51,7 @@ describe Notice do
51 51 describe "user agent string" do
52 52 it "should be parsed and human-readable" do
53 53 notice = Fabricate.build(:notice, :request => {'cgi-data' => {'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16'}})
54   - notice.user_agent_string.should == 'Chrome 10.0.648.204'
  54 + notice.user_agent_string.should == 'Chrome 10.0.648.204 (Intel Mac OS X 10_6_7)'
55 55 end
56 56  
57 57 it "should be nil if HTTP_USER_AGENT is blank" do
... ...
spec/models/problem_spec.rb
... ... @@ -328,7 +328,7 @@ describe Problem do
328 328 it "adding a notice adds a string to #user_agents" do
329 329 lambda {
330 330 Fabricate(:notice, :err => @err, :request => {'cgi-data' => {'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16'}})
331   - }.should change(@problem, :user_agents).from({}).to({Digest::MD5.hexdigest('Chrome 10.0.648.204') => {'value' => 'Chrome 10.0.648.204', 'count' => 1}})
  331 + }.should change(@problem, :user_agents).from({}).to({Digest::MD5.hexdigest('Chrome 10.0.648.204 (Intel Mac OS X 10_6_7)') => {'value' => 'Chrome 10.0.648.204 (Intel Mac OS X 10_6_7)', 'count' => 1}})
332 332 end
333 333  
334 334 it "removing a notice removes string from #user_agents" do
... ... @@ -336,7 +336,7 @@ describe Problem do
336 336 lambda {
337 337 @err.notices.first.destroy
338 338 @problem.reload
339   - }.should change(@problem, :user_agents).from({Digest::MD5.hexdigest('Chrome 10.0.648.204') => {'value' => 'Chrome 10.0.648.204', 'count' => 1}}).to({})
  339 + }.should change(@problem, :user_agents).from({Digest::MD5.hexdigest('Chrome 10.0.648.204 (Intel Mac OS X 10_6_7)') => {'value' => 'Chrome 10.0.648.204 (Intel Mac OS X 10_6_7)', 'count' => 1}}).to({})
340 340 end
341 341 end
342 342  
... ...