diff --git a/app/models/notice.rb b/app/models/notice.rb index 62f2316..604f21b 100644 --- a/app/models/notice.rb +++ b/app/models/notice.rb @@ -64,7 +64,7 @@ class Notice end def request - read_attribute(:request) || {} + super || {} end def url diff --git a/spec/models/notice_spec.rb b/spec/models/notice_spec.rb index eafb35c..5bc8b89 100644 --- a/spec/models/notice_spec.rb +++ b/spec/models/notice_spec.rb @@ -1,8 +1,6 @@ require 'spec_helper' describe Notice do - - context 'validations' do it 'requires a backtrace' do notice = Fabricate.build(:notice, :backtrace => nil) @@ -23,7 +21,6 @@ describe Notice do end end - describe "key sanitization" do before do @hash = { "some.key" => { "$nested.key" => {"$Path" => "/", "some$key" => "key"}}} @@ -38,7 +35,6 @@ describe Notice do end end - describe "user agent" do it "should be parsed and human-readable" do 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'}}) @@ -80,4 +76,11 @@ describe Notice do notice.host.should == 'N/A' end end + + describe "request" do + it "returns empty hash if not set" do + notice = Notice.new + notice.request.should == {} + end + end end -- libgit2 0.21.2