jasperserver-rails 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f48c0e4458048639c97c036022610dbd449e0de
4
- data.tar.gz: 409390426e343bf4a5bc38ec2c8eebe06a8429fd
3
+ metadata.gz: a27409a5e6a91607cc06bf3336ac971cefa828f8
4
+ data.tar.gz: c93a4b4ba67c65675a05c2acda3d8b1b93bd7f3f
5
5
  SHA512:
6
- metadata.gz: 92efa5a3c29e6019b47b9cc4940c0fc85037f8c5c59037f743d1266819397a4d23c78c53fbde7bfda2e35ff20687e690685a03d28f550f5a7cc7abf40575f32c
7
- data.tar.gz: d8cd433f37c2337afccfb80b0dd1a7f1ade341aafeb7e249f9882770a16e524b47784719b4f7730cb961a72a38319d671fe7ed4392e5806be93ac46d97596cd1
6
+ metadata.gz: 1c490ff5b313c350ad6ad971c66406442b51ee2245f194c2e3dcb642df9fe57f4b385175021ec0557300c6555d2139d151b70fd26c089bd47dc7c6215f659c5a
7
+ data.tar.gz: 4e38c6a358f65ca65b0ee05c5a9a5bc0165195e008b45ff49b54111ee9c57bc9930908f38ae0a7972d9745824de93c314b4d8f2f09ad4d6fa8bf160500459e65
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
- # JasperserverRails [![Gem Version](https://badge.fury.io/rb/jasperserver-rails.png)](http://badge.fury.io/rb/jasperserver-rails) [![Build Status](https://secure.travis-ci.org/cmckni3/jasperserver-rails.png)](http://travis-ci.org/cmckni3/jasperserver-rails) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/cmckni3/jasperserver-rails)
1
+ # JasperserverRails
2
+ [![Gem Version](https://badge.fury.io/rb/jasperserver-rails.png)](http://badge.fury.io/rb/jasperserver-rails)
3
+ [![Build Status](https://travis-ci.org/cmckni3/rails-jasperserver.svg?branch=master)](https://travis-ci.org/cmckni3/rails-jasperserver)
4
+ [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/cmckni3/jasperserver-rails)
2
5
 
3
6
  Download reports in various formats from jasperserver
4
7
 
@@ -3,8 +3,7 @@ require 'uri'
3
3
  require 'rest-client'
4
4
  module JasperserverRails
5
5
  class Jasperserver
6
-
7
- self.class_eval do
6
+ class_eval do
8
7
  [:report, :format, :params].each do |method|
9
8
  define_method method do |arg|
10
9
  arg = arg.collect { |key, value| [key, value] } if method == :params
@@ -26,31 +25,46 @@ module JasperserverRails
26
25
  instance_eval(&block) if block_given?
27
26
  login
28
27
  # Run report
29
- response2 = RestClient.get(
30
- URI.join(Rails.configuration.jasperserver[Rails.env.to_sym][:url] + '/', "rest_v2/reports/reports/#{self.get_report}.#{self.get_format}?#{URI.encode_www_form(self.get_params)}").to_s,
28
+ report_path = [
29
+ 'rest_v2',
30
+ 'reports',
31
+ "#{self.get_report}.#{self.get_format}?#{URI.encode_www_form(self.get_params)}"
32
+ ].join '/'
33
+ report_data = RestClient.get(
34
+ URI.join(
35
+ config[:url],
36
+ report_path
37
+ ).to_s,
31
38
  { cookies: @cookie }
32
39
  )
33
40
 
34
41
  # Write file
35
42
  FileUtils.mkdir_p(File.expand_path(filename).split('/')[0..-2].join('/'))
36
43
  f = File.new(filename, 'wb')
37
- f.write(response2.body)
44
+ f.write(report_data.body)
38
45
  f.close
39
46
  end
40
47
 
41
48
  private
42
49
 
50
+ def config
51
+ Rails.configuration.jasperserver[Rails.env.to_sym]
52
+ end
53
+
43
54
  def login
44
55
  # login
45
56
  unless @cookie
46
- response = RestClient.post(
47
- URI.join(Rails.configuration.jasperserver[Rails.env.to_sym][:url] + '/', 'rest/login').to_s,
57
+ @cookie = RestClient.post(
58
+ [
59
+ config[:url],
60
+ 'rest',
61
+ 'login'
62
+ ].join('/').to_s,
48
63
  {
49
- j_username: Rails.configuration.jasperserver[Rails.env.to_sym][:username],
50
- j_password: Rails.configuration.jasperserver[Rails.env.to_sym][:password]
64
+ j_username: config[:username],
65
+ j_password: config[:password]
51
66
  }
52
- )
53
- @cookie = response.cookies
67
+ ).cookies
54
68
  end
55
69
  end
56
70
  end
@@ -1,3 +1,3 @@
1
1
  module JasperserverRails
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -1,3 +1,9 @@
1
1
  Rails.configuration.after_initialize do
2
- Rails.configuration.jasperserver = { test: { url: 'http://localhost:3000', username: 'username', password: 'password' } }
2
+ Rails.configuration.jasperserver = {
3
+ test: {
4
+ url: 'http://localhost:3000',
5
+ username: 'username',
6
+ password: 'password'
7
+ }
8
+ }
3
9
  end
@@ -0,0 +1,138 @@
1
+ DEPRECATION WARNING: config.active_record.whitelist_attributes is deprecated and have no effect. Remove its call from the configuration. (called from block in tsort_each at /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/2.2.0/tsort.rb:226)
2
+ DEPRECATION WARNING: You didn't set `secret_key_base`. Read the upgrade documentation to learn more about this new config option. (called from require at script/rails:6)
3
+
4
+
5
+ Started POST "/login" for 127.0.0.1 at 2015-10-02 12:59:39 -0500
6
+
7
+ NoMethodError (undefined method `auto_explain_threshold_in_seconds=' for #<Class:0x007fb2aab5f158>):
8
+ activerecord (4.2.4) lib/active_record/dynamic_matchers.rb:26:in `method_missing'
9
+ activerecord (4.2.4) lib/active_record/railtie.rb:108:in `block (3 levels) in <class:Railtie>'
10
+ activerecord (4.2.4) lib/active_record/railtie.rb:107:in `each'
11
+ activerecord (4.2.4) lib/active_record/railtie.rb:107:in `block (2 levels) in <class:Railtie>'
12
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
13
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
14
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
15
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `each'
16
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
17
+ activerecord (4.2.4) lib/active_record/base.rb:315:in `<module:ActiveRecord>'
18
+ activerecord (4.2.4) lib/active_record/base.rb:26:in `<top (required)>'
19
+ activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:660:in `rescue in call'
20
+ activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:651:in `call'
21
+ actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
22
+ activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
23
+ activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
24
+ activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
25
+ actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
26
+ actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
27
+ actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
28
+ actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
29
+ actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
30
+ railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
31
+ railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
32
+ activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
33
+ activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
34
+ activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
35
+ railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
36
+ actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
37
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
38
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
39
+ activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
40
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
41
+ actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
42
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
43
+ railties (4.2.4) lib/rails/engine.rb:518:in `call'
44
+ railties (4.2.4) lib/rails/application.rb:165:in `call'
45
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
46
+ thin (1.6.4) lib/thin/connection.rb:86:in `block in pre_process'
47
+ thin (1.6.4) lib/thin/connection.rb:84:in `catch'
48
+ thin (1.6.4) lib/thin/connection.rb:84:in `pre_process'
49
+ thin (1.6.4) lib/thin/connection.rb:53:in `process'
50
+ thin (1.6.4) lib/thin/connection.rb:39:in `receive_data'
51
+ eventmachine (1.0.8) lib/eventmachine.rb:193:in `run_machine'
52
+ eventmachine (1.0.8) lib/eventmachine.rb:193:in `run'
53
+ thin (1.6.4) lib/thin/backends/base.rb:73:in `start'
54
+ thin (1.6.4) lib/thin/server.rb:162:in `start'
55
+ rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
56
+ rack (1.6.4) lib/rack/server.rb:286:in `start'
57
+ railties (4.2.4) lib/rails/commands/server.rb:80:in `start'
58
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:80:in `block in server'
59
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `tap'
60
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `server'
61
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
62
+ railties (4.2.4) lib/rails/commands.rb:17:in `<top (required)>'
63
+ script/rails:6:in `require'
64
+ script/rails:6:in `<main>'
65
+
66
+
67
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.1ms)
68
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.1ms)
69
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
70
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (56.9ms)
71
+
72
+
73
+ Started POST "/login" for 127.0.0.1 at 2015-10-02 12:59:39 -0500
74
+
75
+ NoMethodError (undefined method `auto_explain_threshold_in_seconds=' for #<Class:0x007fb2aab5f158>):
76
+ activerecord (4.2.4) lib/active_record/dynamic_matchers.rb:26:in `method_missing'
77
+ activerecord (4.2.4) lib/active_record/railtie.rb:108:in `block (3 levels) in <class:Railtie>'
78
+ activerecord (4.2.4) lib/active_record/railtie.rb:107:in `each'
79
+ activerecord (4.2.4) lib/active_record/railtie.rb:107:in `block (2 levels) in <class:Railtie>'
80
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
81
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
82
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
83
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `each'
84
+ activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
85
+ activerecord (4.2.4) lib/active_record/base.rb:315:in `<module:ActiveRecord>'
86
+ activerecord (4.2.4) lib/active_record/base.rb:26:in `<top (required)>'
87
+ activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:660:in `rescue in call'
88
+ activerecord (4.2.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:651:in `call'
89
+ actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
90
+ activesupport (4.2.4) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
91
+ activesupport (4.2.4) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
92
+ activesupport (4.2.4) lib/active_support/callbacks.rb:81:in `run_callbacks'
93
+ actionpack (4.2.4) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
94
+ actionpack (4.2.4) lib/action_dispatch/middleware/reloader.rb:73:in `call'
95
+ actionpack (4.2.4) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
96
+ actionpack (4.2.4) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
97
+ actionpack (4.2.4) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
98
+ railties (4.2.4) lib/rails/rack/logger.rb:38:in `call_app'
99
+ railties (4.2.4) lib/rails/rack/logger.rb:20:in `block in call'
100
+ activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `block in tagged'
101
+ activesupport (4.2.4) lib/active_support/tagged_logging.rb:26:in `tagged'
102
+ activesupport (4.2.4) lib/active_support/tagged_logging.rb:68:in `tagged'
103
+ railties (4.2.4) lib/rails/rack/logger.rb:20:in `call'
104
+ actionpack (4.2.4) lib/action_dispatch/middleware/request_id.rb:21:in `call'
105
+ rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
106
+ rack (1.6.4) lib/rack/runtime.rb:18:in `call'
107
+ activesupport (4.2.4) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
108
+ rack (1.6.4) lib/rack/lock.rb:17:in `call'
109
+ actionpack (4.2.4) lib/action_dispatch/middleware/static.rb:116:in `call'
110
+ rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
111
+ railties (4.2.4) lib/rails/engine.rb:518:in `call'
112
+ railties (4.2.4) lib/rails/application.rb:165:in `call'
113
+ rack (1.6.4) lib/rack/content_length.rb:15:in `call'
114
+ thin (1.6.4) lib/thin/connection.rb:86:in `block in pre_process'
115
+ thin (1.6.4) lib/thin/connection.rb:84:in `catch'
116
+ thin (1.6.4) lib/thin/connection.rb:84:in `pre_process'
117
+ thin (1.6.4) lib/thin/connection.rb:53:in `process'
118
+ thin (1.6.4) lib/thin/connection.rb:39:in `receive_data'
119
+ eventmachine (1.0.8) lib/eventmachine.rb:193:in `run_machine'
120
+ eventmachine (1.0.8) lib/eventmachine.rb:193:in `run'
121
+ thin (1.6.4) lib/thin/backends/base.rb:73:in `start'
122
+ thin (1.6.4) lib/thin/server.rb:162:in `start'
123
+ rack (1.6.4) lib/rack/handler/thin.rb:19:in `run'
124
+ rack (1.6.4) lib/rack/server.rb:286:in `start'
125
+ railties (4.2.4) lib/rails/commands/server.rb:80:in `start'
126
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:80:in `block in server'
127
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `tap'
128
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:75:in `server'
129
+ railties (4.2.4) lib/rails/commands/commands_tasks.rb:39:in `run_command!'
130
+ railties (4.2.4) lib/rails/commands.rb:17:in `<top (required)>'
131
+ script/rails:6:in `require'
132
+ script/rails:6:in `<main>'
133
+
134
+
135
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.1ms)
136
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.3ms)
137
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.0ms)
138
+ Rendered /Users/cmcknight/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/actionpack-4.2.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (54.9ms)
@@ -1,18 +1,229 @@
1
- Connecting to database specified by database.yml
2
-  (0.2ms) begin transaction
1
+  (0.1ms) begin transaction
2
+ -------------------------------------------------------------------------
3
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
4
+ -------------------------------------------------------------------------
5
+  (0.1ms) rollback transaction
6
+  (0.0ms) begin transaction
7
+ -------------------------------------------------
8
+ JasperserverRailsTest: test_test.pdf_is_generated
9
+ -------------------------------------------------
10
+  (0.0ms) rollback transaction
11
+  (0.0ms) begin transaction
12
+ --------------------------------------------------
13
+ JasperserverRailsTest: test_test2.pdf_is_generated
14
+ --------------------------------------------------
15
+  (0.0ms) rollback transaction
16
+  (0.0ms) begin transaction
17
+ --------------------------------------------------
18
+ JasperserverRailsTest: test_test3.pdf_is_generated
19
+ --------------------------------------------------
20
+  (0.1ms) rollback transaction
21
+  (0.1ms) begin transaction
22
+ -------------------------------------------------------------------------
23
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
24
+ -------------------------------------------------------------------------
25
+  (0.1ms) rollback transaction
26
+  (0.0ms) begin transaction
27
+ -------------------------------------------------
28
+ JasperserverRailsTest: test_test.pdf_is_generated
29
+ -------------------------------------------------
30
+  (0.0ms) rollback transaction
31
+  (0.0ms) begin transaction
32
+ --------------------------------------------------
33
+ JasperserverRailsTest: test_test2.pdf_is_generated
34
+ --------------------------------------------------
35
+  (0.0ms) rollback transaction
36
+  (0.0ms) begin transaction
37
+ --------------------------------------------------
38
+ JasperserverRailsTest: test_test3.pdf_is_generated
39
+ --------------------------------------------------
40
+  (0.1ms) rollback transaction
41
+  (0.1ms) begin transaction
42
+ -------------------------------------------------------------------------
43
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
44
+ -------------------------------------------------------------------------
45
+  (0.1ms) rollback transaction
46
+  (0.0ms) begin transaction
47
+ -------------------------------------------------
48
+ JasperserverRailsTest: test_test.pdf_is_generated
49
+ -------------------------------------------------
50
+  (0.0ms) rollback transaction
51
+  (0.0ms) begin transaction
52
+ --------------------------------------------------
53
+ JasperserverRailsTest: test_test2.pdf_is_generated
54
+ --------------------------------------------------
55
+  (0.0ms) rollback transaction
56
+  (0.0ms) begin transaction
57
+ --------------------------------------------------
58
+ JasperserverRailsTest: test_test3.pdf_is_generated
59
+ --------------------------------------------------
60
+  (0.1ms) rollback transaction
61
+  (0.1ms) begin transaction
62
+ -------------------------------------------------------------------------
63
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
64
+ -------------------------------------------------------------------------
65
+  (0.1ms) rollback transaction
66
+  (0.0ms) begin transaction
67
+ -------------------------------------------------
68
+ JasperserverRailsTest: test_test.pdf_is_generated
69
+ -------------------------------------------------
70
+  (0.0ms) rollback transaction
71
+  (0.0ms) begin transaction
72
+ --------------------------------------------------
73
+ JasperserverRailsTest: test_test2.pdf_is_generated
74
+ --------------------------------------------------
75
+  (0.0ms) rollback transaction
76
+  (0.1ms) begin transaction
77
+ --------------------------------------------------
78
+ JasperserverRailsTest: test_test3.pdf_is_generated
79
+ --------------------------------------------------
80
+  (0.1ms) rollback transaction
81
+  (0.1ms) begin transaction
82
+ -------------------------------------------------------------------------
83
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
84
+ -------------------------------------------------------------------------
85
+  (0.1ms) rollback transaction
86
+  (0.0ms) begin transaction
87
+ -------------------------------------------------
88
+ JasperserverRailsTest: test_test.pdf_is_generated
89
+ -------------------------------------------------
90
+  (0.0ms) rollback transaction
91
+  (0.0ms) begin transaction
92
+ --------------------------------------------------
93
+ JasperserverRailsTest: test_test2.pdf_is_generated
94
+ --------------------------------------------------
95
+  (0.0ms) rollback transaction
96
+  (0.0ms) begin transaction
97
+ --------------------------------------------------
98
+ JasperserverRailsTest: test_test3.pdf_is_generated
99
+ --------------------------------------------------
100
+  (0.1ms) rollback transaction
101
+  (0.1ms) begin transaction
102
+ -------------------------------------------------------------------------
103
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
104
+ -------------------------------------------------------------------------
105
+  (0.1ms) rollback transaction
106
+  (0.1ms) begin transaction
107
+ -------------------------------------------------
108
+ JasperserverRailsTest: test_test.pdf_is_generated
109
+ -------------------------------------------------
3
110
   (0.1ms) rollback transaction
4
111
   (0.0ms) begin transaction
112
+ --------------------------------------------------
113
+ JasperserverRailsTest: test_test2.pdf_is_generated
114
+ --------------------------------------------------
115
+  (0.0ms) rollback transaction
116
+  (0.1ms) begin transaction
117
+ --------------------------------------------------
118
+ JasperserverRailsTest: test_test3.pdf_is_generated
119
+ --------------------------------------------------
5
120
   (0.1ms) rollback transaction
121
+  (0.1ms) begin transaction
122
+ -------------------------------------------------------------------------
123
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
124
+ -------------------------------------------------------------------------
125
+  (0.1ms) rollback transaction
126
+  (0.1ms) begin transaction
127
+ -------------------------------------------------
128
+ JasperserverRailsTest: test_test.pdf_is_generated
129
+ -------------------------------------------------
130
+  (0.0ms) rollback transaction
6
131
   (0.0ms) begin transaction
132
+ --------------------------------------------------
133
+ JasperserverRailsTest: test_test2.pdf_is_generated
134
+ --------------------------------------------------
135
+  (0.0ms) rollback transaction
136
+  (0.1ms) begin transaction
137
+ --------------------------------------------------
138
+ JasperserverRailsTest: test_test3.pdf_is_generated
139
+ --------------------------------------------------
140
+  (0.1ms) rollback transaction
141
+  (0.1ms) begin transaction
142
+ -------------------------------------------------------------------------
143
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
144
+ -------------------------------------------------------------------------
145
+  (0.1ms) rollback transaction
146
+  (0.0ms) begin transaction
147
+ -------------------------------------------------
148
+ JasperserverRailsTest: test_test.pdf_is_generated
149
+ -------------------------------------------------
150
+  (0.0ms) rollback transaction
151
+  (0.0ms) begin transaction
152
+ --------------------------------------------------
153
+ JasperserverRailsTest: test_test2.pdf_is_generated
154
+ --------------------------------------------------
155
+  (0.0ms) rollback transaction
156
+  (0.0ms) begin transaction
157
+ --------------------------------------------------
158
+ JasperserverRailsTest: test_test3.pdf_is_generated
159
+ --------------------------------------------------
7
160
   (0.1ms) rollback transaction
8
161
   (0.1ms) begin transaction
162
+ -------------------------------------------------------------------------
163
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
164
+ -------------------------------------------------------------------------
165
+  (0.1ms) rollback transaction
166
+  (0.0ms) begin transaction
167
+ -------------------------------------------------
168
+ JasperserverRailsTest: test_test.pdf_is_generated
169
+ -------------------------------------------------
170
+  (0.0ms) rollback transaction
171
+  (0.0ms) begin transaction
172
+ --------------------------------------------------
173
+ JasperserverRailsTest: test_test2.pdf_is_generated
174
+ --------------------------------------------------
9
175
   (0.0ms) rollback transaction
176
+  (0.0ms) begin transaction
177
+ --------------------------------------------------
178
+ JasperserverRailsTest: test_test3.pdf_is_generated
179
+ --------------------------------------------------
180
+  (0.1ms) rollback transaction
10
181
   (0.1ms) begin transaction
11
182
  -------------------------------------------------------------------------
12
183
  JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
13
184
  -------------------------------------------------------------------------
185
+  (0.2ms) rollback transaction
186
+  (0.1ms) begin transaction
187
+ -------------------------------------------------
188
+ JasperserverRailsTest: test_test.pdf_is_generated
189
+ -------------------------------------------------
190
+  (0.1ms) rollback transaction
191
+  (0.1ms) begin transaction
192
+ --------------------------------------------------
193
+ JasperserverRailsTest: test_test2.pdf_is_generated
194
+ --------------------------------------------------
14
195
   (0.1ms) rollback transaction
15
196
   (0.0ms) begin transaction
197
+ --------------------------------------------------
198
+ JasperserverRailsTest: test_test3.pdf_is_generated
199
+ --------------------------------------------------
200
+  (0.1ms) rollback transaction
201
+  (0.1ms) begin transaction
202
+ -------------------------------------------------------------------------
203
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
204
+ -------------------------------------------------------------------------
205
+  (0.1ms) rollback transaction
206
+  (0.0ms) begin transaction
207
+ -------------------------------------------------
208
+ JasperserverRailsTest: test_test.pdf_is_generated
209
+ -------------------------------------------------
210
+  (0.1ms) rollback transaction
211
+  (0.0ms) begin transaction
212
+ --------------------------------------------------
213
+ JasperserverRailsTest: test_test2.pdf_is_generated
214
+ --------------------------------------------------
215
+  (0.1ms) rollback transaction
216
+  (0.0ms) begin transaction
217
+ --------------------------------------------------
218
+ JasperserverRailsTest: test_test3.pdf_is_generated
219
+ --------------------------------------------------
220
+  (0.1ms) rollback transaction
221
+  (0.1ms) begin transaction
222
+ -------------------------------------------------------------------------
223
+ JasperserverRailsTest: test_stays_logged_in_when_running_multiple_reports
224
+ -------------------------------------------------------------------------
225
+  (0.1ms) rollback transaction
226
+  (0.1ms) begin transaction
16
227
  -------------------------------------------------
17
228
  JasperserverRailsTest: test_test.pdf_is_generated
18
229
  -------------------------------------------------
@@ -3,76 +3,88 @@ require 'test_helper'
3
3
  require 'vcr'
4
4
 
5
5
  VCR.configure do |c|
6
+ jasper_config = Rails.configuration.jasperserver[Rails.env.to_sym]
6
7
  c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
7
8
  c.hook_into :webmock
8
- c.default_cassette_options = { record: :new_episodes, erb: true }
9
- c.filter_sensitive_data('<USERNAME>') { Rails.configuration.jasperserver[Rails.env.to_sym][:username] }
10
- c.filter_sensitive_data('<PASSWORD>') { Rails.configuration.jasperserver[Rails.env.to_sym][:password] }
11
- c.filter_sensitive_data('<URL>') { Rails.configuration.jasperserver[Rails.env.to_sym][:url] }
9
+ c.default_cassette_options = { record: :none, erb: true }
10
+ c.filter_sensitive_data('<USERNAME>') { jasper_config[:username] }
11
+ c.filter_sensitive_data('<PASSWORD>') { jasper_config[:password] }
12
+ c.filter_sensitive_data('<URL>') { jasper_config[:url] }
12
13
  c.filter_sensitive_data('<SET-COOKIE>') do |interaction|
13
- interaction.response.headers['Set-Cookie'].first if interaction.response.headers['Set-Cookie']
14
+ if interaction.response.headers['Set-Cookie']
15
+ interaction.response.headers['Set-Cookie'].first
16
+ end
14
17
  end
15
18
  c.filter_sensitive_data('<COOKIE>') do |interaction|
16
- interaction.request.headers['Cookie'].first if interaction.request.headers['Cookie']
19
+ if interaction.request.headers['Cookie']
20
+ interaction.request.headers['Cookie'].first
21
+ end
17
22
  end
18
23
  c.filter_sensitive_data('<SERVER>') do |interaction|
19
- interaction.response.headers['Server'].first if interaction.response.headers['Server']
24
+ if interaction.response.headers['Server']
25
+ interaction.response.headers['Server'].first
26
+ end
20
27
  end
21
28
  end
22
29
 
23
30
  class JasperserverRailsTest < ActiveSupport::TestCase
24
- test "test.pdf is generated" do
25
- VCR.use_cassette('test1') do
31
+ test 'test.pdf is generated' do
32
+ report_file = 'test/dummy/tmp/reports/test.pdf'
33
+ VCR.use_cassette 'test1' do
26
34
  JasperserverRails::Jasperserver.new do
27
35
  format 'pdf'
28
- report 'samples/Department'
36
+ report 'reports/samples/Department'
29
37
  params({ Value1: 'Value1', Value2: 'Value2' })
30
- run_report('test/dummy/tmp/reports/test.pdf')
38
+ run_report report_file
31
39
  end
32
40
  end
33
- File.exists?('test/dummy/tmp/reports/test.pdf')
41
+ File.exist? report_file
34
42
  end
35
43
 
36
- test "test2.pdf is generated" do
37
- VCR.use_cassette('test2') do
44
+ test 'test2.pdf is generated' do
45
+ report_file = 'test/dummy/tmp/reports/test2.pdf'
46
+ VCR.use_cassette 'test2' do
38
47
  JasperserverRails::Jasperserver.new do
39
48
  format 'pdf'
40
- report 'samples/Department'
49
+ report 'reports/samples/Department'
41
50
  params({ Value1: 'Value1' })
42
- run_report('test/dummy/tmp/reports/test2.pdf')
51
+ run_report report_file
43
52
  end
44
53
  end
45
- File.exists?('test/dummy/tmp/reports/test2.pdf')
54
+ File.exist? report_file
46
55
  end
47
56
 
48
- test "test3.pdf is generated" do
49
- VCR.use_cassette('test3') do
50
- JasperserverRails::Jasperserver.new.run_report 'test/dummy/tmp/reports/test3.pdf' do
57
+ test 'test3.pdf is generated' do
58
+ report_file = 'test/dummy/tmp/reports/test3.pdf'
59
+ VCR.use_cassette 'test3' do
60
+ JasperserverRails::Jasperserver.new.run_report report_file do
51
61
  format 'pdf'
52
- report 'samples/Department'
62
+ report 'reports/samples/Department'
53
63
  params({ Value1: 'Value1' })
54
64
  end
55
65
  end
56
- File.exists?('test/dummy/tmp/reports/test3.pdf')
66
+ File.exist? report_file
57
67
  end
58
68
 
59
- test "stays logged in when running multiple reports" do
60
- VCR.use_cassette('test4') do
61
- JasperserverRails::Jasperserver.new.run_report 'test/dummy/tmp/reports/test4.pdf' do
69
+ test 'stays logged in when running multiple reports' do
70
+ report_file = 'test/dummy/tmp/reports/test4.pdf'
71
+ VCR.use_cassette 'test4' do
72
+ JasperserverRails::Jasperserver.new.run_report report_file do
62
73
  format 'pdf'
63
- report 'samples/Department'
74
+ report 'reports/samples/Department'
64
75
  params({ Value1: 'Value1' })
65
76
  end
66
77
  end
67
- File.exists?('test/dummy/tmp/reports/test4.pdf')
78
+ File.exist? report_file
68
79
 
69
- VCR.use_cassette('test5') do
70
- JasperserverRails::Jasperserver.new.run_report 'test/dummy/tmp/reports/test5.pdf' do
80
+ report_file = 'test/dummy/tmp/reports/test5.pdf'
81
+ VCR.use_cassette 'test5' do
82
+ JasperserverRails::Jasperserver.new.run_report report_file do
71
83
  format 'pdf'
72
- report 'samples/Department'
84
+ report 'reports/samples/Department'
73
85
  params({ Value1: 'Value1' })
74
86
  end
75
87
  end
76
- File.exists?('test/dummy/tmp/reports/test5.pdf')
88
+ File.exist? report_file
77
89
  end
78
90
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jasperserver-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris McKnight
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -83,6 +83,7 @@ files:
83
83
  - test/dummy/config/locales/en.yml
84
84
  - test/dummy/config/routes.rb
85
85
  - test/dummy/db/test.sqlite3
86
+ - test/dummy/log/development.log
86
87
  - test/dummy/log/test.log
87
88
  - test/dummy/public/404.html
88
89
  - test/dummy/public/422.html
@@ -120,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
121
  version: '0'
121
122
  requirements: []
122
123
  rubyforge_project:
123
- rubygems_version: 2.4.5
124
+ rubygems_version: 2.4.5.1
124
125
  signing_key:
125
126
  specification_version: 4
126
127
  summary: Download reports in various formats from jasperserver
@@ -148,6 +149,7 @@ test_files:
148
149
  - test/dummy/config/routes.rb
149
150
  - test/dummy/config.ru
150
151
  - test/dummy/db/test.sqlite3
152
+ - test/dummy/log/development.log
151
153
  - test/dummy/log/test.log
152
154
  - test/dummy/public/404.html
153
155
  - test/dummy/public/422.html