flail 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flail (0.0.3)
4
+ flail (0.0.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -43,7 +43,7 @@ class Flail
43
43
  info = {}
44
44
 
45
45
  # rack env
46
- info[:rack] = @env.to_json(:except => ['flail.request', 'flail.request.data'])
46
+ info[:rack] = @env.except('flail.request', 'flail.request.data')
47
47
  info[:class_name] = @exception.class.to_s # @exception class
48
48
  info[:message] = @exception.to_s # error message
49
49
  info[:trace] = @exception.backtrace # backtrace of error
data/lib/flail/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Flail
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
+ require 'ostruct'
3
4
  require 'flail/rails/rescue_action'
4
5
 
5
6
  describe Flail::Rails::RescueAction do
@@ -41,5 +42,12 @@ describe Flail::Rails::RescueAction do
41
42
 
42
43
  FlailArmory.payload['session_data'].should == data
43
44
  end
45
+
46
+ it "should send user data" do
47
+ user = OpenStruct.new(:attributes => {:id => 1, :login => 'jlong'})
48
+ FlailArmory.process_action_with_error(:user => user)
49
+
50
+ FlailArmory.payload['user'].should == {'id' => 1, 'login' => 'jlong'}
51
+ end
44
52
  end
45
53
  end
data/spec/spec_helper.rb CHANGED
@@ -51,6 +51,10 @@ class FlailArmory
51
51
  cattr_accessor :local
52
52
  define_method(:index, &action)
53
53
 
54
+ def current_user
55
+ @current_user
56
+ end
57
+
54
58
  def local_request?
55
59
  local
56
60
  end
@@ -68,10 +72,15 @@ class FlailArmory
68
72
  klass.local = options[:local]
69
73
 
70
74
  controller = klass.new
75
+
76
+ if options[:user]
77
+ controller.instance_variable_set(:@current_user, options[:user])
78
+ end
79
+
71
80
  options[:request].query_parameters = options[:request].query_parameters.merge(options[:params] || {})
72
81
  options[:request].session = ActionController::TestSession.new(options[:session] || {})
73
-
74
82
  options[:request].env['REQUEST_URI'] = options[:request].request_uri
83
+
75
84
  controller.process(options[:request], options[:response])
76
85
  controller
77
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: