Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranlee committed Nov 9, 2010
2 parents f9fbbf4 + b0e857a commit 2396956
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/exceptional/exception_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def to_hash
'exception_class' => @exception.class.to_s,
'message' => @exception.message,
'backtrace' => @exception.backtrace,
'occurred_at' => Time.now
'occurred_at' => Time.now.utc.iso8601
}
})
hash.merge!(extra_stuff)
Expand Down
7 changes: 7 additions & 0 deletions spec/exceptional/exception_data_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ def to_json
data.to_hash['request']['parameters'].should == {'var1' => '[FILTERED]'}
end

it "formats the occurred_at as iso8601" do
@request.stub!(:env).and_return({'SOME_VAR' => 'abc', 'HTTP_CONTENT_TYPE' => 'text/html', 'action_dispatch.parameter_filter' => [:var1]})
@request.stub!(:parameters).and_return({'var1' => 'abc'})
data = Exceptional::ControllerExceptionData.new(@error, @controller, @request)
data.to_hash['exception']['occurred_at'].should match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.{1,6}$/)
end

it "ArgumentError bug with file object" do
file = File.new(File.expand_path('../../fixtures/favicon.png',__FILE__))
@request.stub!(:parameters).and_return({'something' => file })
Expand Down

0 comments on commit 2396956

Please sign in to comment.