Commit 2943c19724dc427c03b122e97ad2d7fbb152200f
1 parent
6c8532e8
Exists in
master
and in
1 other branch
call super instead of read_attribute
Showing
2 changed files
with
8 additions
and
5 deletions
Show diff stats
app/models/notice.rb
spec/models/notice_spec.rb
1 | 1 | require 'spec_helper' |
2 | 2 | |
3 | 3 | describe Notice do |
4 | - | |
5 | - | |
6 | 4 | context 'validations' do |
7 | 5 | it 'requires a backtrace' do |
8 | 6 | notice = Fabricate.build(:notice, :backtrace => nil) |
... | ... | @@ -23,7 +21,6 @@ describe Notice do |
23 | 21 | end |
24 | 22 | end |
25 | 23 | |
26 | - | |
27 | 24 | describe "key sanitization" do |
28 | 25 | before do |
29 | 26 | @hash = { "some.key" => { "$nested.key" => {"$Path" => "/", "some$key" => "key"}}} |
... | ... | @@ -38,7 +35,6 @@ describe Notice do |
38 | 35 | end |
39 | 36 | end |
40 | 37 | |
41 | - | |
42 | 38 | describe "user agent" do |
43 | 39 | it "should be parsed and human-readable" do |
44 | 40 | 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 |
80 | 76 | notice.host.should == 'N/A' |
81 | 77 | end |
82 | 78 | end |
79 | + | |
80 | + describe "request" do | |
81 | + it "returns empty hash if not set" do | |
82 | + notice = Notice.new | |
83 | + notice.request.should == {} | |
84 | + end | |
85 | + end | |
83 | 86 | end | ... | ... |