frikandel 2.1.0 → 2.2.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.
@@ -0,0 +1,76 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV['RAILS_ENV'] ||= 'test'
3
+ require File.expand_path("../dummy/config/environment", __FILE__)
4
+ # Prevent database truncation if the environment is production
5
+ abort("The Rails environment is running in production mode!") if Rails.env.production?
6
+ require 'spec_helper'
7
+ require 'rspec/rails'
8
+ # Add additional requires below this line. Rails is not loaded until this point!
9
+
10
+ # Requires supporting ruby files with custom matchers and macros, etc, in
11
+ # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
12
+ # run as spec files by default. This means that files in spec/support that end
13
+ # in _spec.rb will both be required and run as specs, causing the specs to be
14
+ # run twice. It is recommended that you do not name files matching this glob to
15
+ # end with _spec.rb. You can configure this pattern with the --pattern
16
+ # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
17
+ #
18
+ # The following line is provided for convenience purposes. It has the downside
19
+ # of increasing the boot-up time by auto-requiring all files in the support
20
+ # directory. Alternatively, in the individual `*_spec.rb` files, manually
21
+ # require only the support files necessary.
22
+ #
23
+ # Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
24
+
25
+ if Dummy::RAILS_GEM_VERSION > Gem::Version.new('4.1.0')
26
+ # Checks for pending migration and applies them before tests are run.
27
+ # If you are not using ActiveRecord, you can remove this line.
28
+ ActiveRecord::Migration.maintain_test_schema!
29
+ end
30
+
31
+ RSpec.configure do |config|
32
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
33
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
34
+
35
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
36
+ # examples within a transaction, remove the following line or assign false
37
+ # instead of true.
38
+ config.use_transactional_fixtures = true
39
+
40
+ # RSpec Rails can automatically mix in different behaviours to your tests
41
+ # based on their file location, for example enabling you to call `get` and
42
+ # `post` in specs under `spec/controllers`.
43
+ #
44
+ # You can disable this behaviour by removing the line below, and instead
45
+ # explicitly tag your specs with their type, e.g.:
46
+ #
47
+ # RSpec.describe UsersController, :type => :controller do
48
+ # # ...
49
+ # end
50
+ #
51
+ # The different available types are documented in the features, such as in
52
+ # https://relishapp.com/rspec/rspec-rails/docs
53
+ config.infer_spec_type_from_file_location!
54
+
55
+ # Filter lines from Rails gems in backtraces.
56
+ config.filter_rails_from_backtrace!
57
+ # arbitrary gems may also be filtered via:
58
+ # config.filter_gems_from_backtrace("gem name")
59
+ end
60
+
61
+
62
+ # some helper methods
63
+
64
+ def simulate_redirect!(from_action, to_action)
65
+ get from_action.intern
66
+ from_flash = request.flash # HACK for RAILS_VERSION=3.2.0
67
+
68
+ controller.instance_variable_set(:@_frikandel_did_reset_session, nil) # reset state for redirect request
69
+
70
+ get to_action.intern
71
+ request.flash.update(from_flash.to_hash) # HACK for RAILS_VERSION=3.2.0
72
+ end
73
+
74
+ def flash
75
+ request.flash
76
+ end
@@ -1,38 +1,102 @@
1
- ENV["RAILS_ENV"] ||= 'test'
2
- require File.expand_path("../dummy/config/environment", __FILE__)
3
- require 'rspec/rails'
4
1
  require 'pry'
5
2
 
3
+ # This file was generated by the `rails generate rspec:install` command. Conventionally, all
4
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
5
+ # The generated `.rspec` file contains `--require spec_helper` which will cause
6
+ # this file to always be loaded, without a need to explicitly require it in any
7
+ # files.
8
+ #
9
+ # Given that it is always loaded, you are encouraged to keep this file as
10
+ # light-weight as possible. Requiring heavyweight dependencies from this file
11
+ # will add to the boot time of your test suite on EVERY test run, even for an
12
+ # individual file that may not need all of that loaded. Instead, consider making
13
+ # a separate helper file that requires the additional dependencies and performs
14
+ # the additional setup, and require it from the spec files that actually need
15
+ # it.
16
+ #
17
+ # The `.rspec` file also contains a few flags that are not defaults but that
18
+ # users commonly want.
19
+ #
6
20
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
21
  RSpec.configure do |config|
8
- config.treat_symbols_as_metadata_keys_with_true_values = true
9
- config.run_all_when_everything_filtered = true
10
- config.filter_run :focus
22
+ # rspec-expectations config goes here. You can use an alternate
23
+ # assertion/expectation library such as wrong or the stdlib/minitest
24
+ # assertions if you prefer.
25
+ config.expect_with :rspec do |expectations|
26
+ # This option will default to `true` in RSpec 4. It makes the `description`
27
+ # and `failure_message` of custom matchers include text for helper methods
28
+ # defined using `chain`, e.g.:
29
+ # be_bigger_than(2).and_smaller_than(4).description
30
+ # # => "be bigger than 2 and smaller than 4"
31
+ # ...rather than:
32
+ # # => "be bigger than 2"
33
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
34
+ end
35
+
36
+ # rspec-mocks config goes here. You can use an alternate test double
37
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
38
+ config.mock_with :rspec do |mocks|
39
+ # Prevents you from mocking or stubbing a method that does not exist on
40
+ # a real object. This is generally recommended, and will default to
41
+ # `true` in RSpec 4.
42
+ mocks.verify_partial_doubles = true
43
+ end
44
+
45
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
46
+ # have no way to turn it off -- the option exists only for backwards
47
+ # compatibility in RSpec 3). It causes shared context metadata to be
48
+ # inherited by the metadata hash of host groups and examples, rather than
49
+ # triggering implicit auto-inclusion in groups with matching metadata.
50
+ config.shared_context_metadata_behavior = :apply_to_host_groups
51
+
52
+ # This allows you to limit a spec run to individual examples or groups
53
+ # you care about by tagging them with `:focus` metadata. When nothing
54
+ # is tagged with `:focus`, all examples get run. RSpec also provides
55
+ # aliases for `it`, `describe`, and `context` that include `:focus`
56
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
57
+ config.filter_run_when_matching :focus
58
+
59
+ # Allows RSpec to persist some state between runs in order to support
60
+ # the `--only-failures` and `--next-failure` CLI options. We recommend
61
+ # you configure your source control system to ignore this file.
62
+ #config.example_status_persistence_file_path = "spec/examples.txt"
63
+
64
+ # Limits the available syntax to the non-monkey patched syntax that is
65
+ # recommended. For more details, see:
66
+ # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
67
+ # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
68
+ # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
69
+ config.disable_monkey_patching!
70
+
71
+ # Many RSpec users commonly either run the entire suite or an individual
72
+ # file, and it's useful to allow more verbose output when running an
73
+ # individual spec file.
74
+ if config.files_to_run.one?
75
+ # Use the documentation formatter for detailed output,
76
+ # unless a formatter has already been configured
77
+ # (e.g. via a command-line flag).
78
+ config.default_formatter = 'doc'
79
+ end
80
+
81
+ # Print the 10 slowest examples and example groups at the
82
+ # end of the spec run, to help surface which specs are running
83
+ # particularly slow.
84
+ #config.profile_examples = 10
11
85
 
12
86
  # Run specs in random order to surface order dependencies. If you find an
13
87
  # order dependency and want to debug it, you can fix the order by providing
14
88
  # the seed, which is printed after each run.
15
89
  # --seed 1234
16
- config.order = 'random'
90
+ config.order = :random
17
91
 
92
+ # Seed global randomization in this process using the `--seed` CLI option.
93
+ # Setting this allows you to use `--seed` to deterministically reproduce
94
+ # test failures related to randomization by passing the same `--seed` value
95
+ # as the one that triggered the failure.
96
+ Kernel.srand config.seed
97
+
98
+ # Frikandel
18
99
  config.before(:each) do
19
100
  Frikandel::Configuration.defaults!
20
101
  end
21
102
  end
22
-
23
-
24
- # some helper methods
25
-
26
- def simulate_redirect!(from_action, to_action)
27
- get from_action.intern
28
- from_flash = request.flash # HACK for RAILS_VERSION=3.2.0
29
-
30
- controller.instance_variable_set(:@_frikandel_did_reset_session, nil) # reset state for redirect request
31
-
32
- get to_action.intern
33
- request.flash.update(from_flash.to_hash) # HACK for RAILS_VERSION=3.2.0
34
- end
35
-
36
- def flash
37
- request.flash
38
- end
@@ -14,6 +14,11 @@ class ApplicationController < ActionController::Base
14
14
  protect_from_forgery with: :exception
15
15
 
16
16
  def home
17
- render text: "testing"
17
+
18
+ if Rails::VERSION::MAJOR >= 5
19
+ render plain: "testing"
20
+ else
21
+ render text: "testing"
22
+ end
18
23
  end
19
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frikandel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taktsoft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -54,6 +54,26 @@ dependencies:
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec-rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '3.6'
65
+ type: :development
66
+ prerelease: false
67
+ version_requirements: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">"
70
+ - !ruby/object:Gem::Version
71
+ version: '3.0'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.6'
75
+ - !ruby/object:Gem::Dependency
76
+ name: guard-rspec
57
77
  requirement: !ruby/object:Gem::Requirement
58
78
  requirements:
59
79
  - - ">="
@@ -67,7 +87,7 @@ dependencies:
67
87
  - !ruby/object:Gem::Version
68
88
  version: '0'
69
89
  - !ruby/object:Gem::Dependency
70
- name: guard-rspec
90
+ name: pry
71
91
  requirement: !ruby/object:Gem::Requirement
72
92
  requirements:
73
93
  - - ">="
@@ -81,7 +101,7 @@ dependencies:
81
101
  - !ruby/object:Gem::Version
82
102
  version: '0'
83
103
  - !ruby/object:Gem::Dependency
84
- name: pry
104
+ name: test-unit
85
105
  requirement: !ruby/object:Gem::Requirement
86
106
  requirements:
87
107
  - - ">="
@@ -103,7 +123,7 @@ dependencies:
103
123
  version: 3.2.0
104
124
  - - "<"
105
125
  - !ruby/object:Gem::Version
106
- version: '5.0'
126
+ version: '5.1'
107
127
  type: :runtime
108
128
  prerelease: false
109
129
  version_requirements: !ruby/object:Gem::Requirement
@@ -113,7 +133,7 @@ dependencies:
113
133
  version: 3.2.0
114
134
  - - "<"
115
135
  - !ruby/object:Gem::Version
116
- version: '5.0'
136
+ version: '5.1'
117
137
  description: This gem adds a ttl to the session cookie of your application.
118
138
  email:
119
139
  - developers@taktsoft.com
@@ -128,6 +148,8 @@ files:
128
148
  - Gemfile.rails-3.2.x
129
149
  - Gemfile.rails-4.0.x
130
150
  - Gemfile.rails-4.1.x
151
+ - Gemfile.rails-4.2.x
152
+ - Gemfile.rails-5.0.x
131
153
  - Gemfile.rails-head
132
154
  - Guardfile
133
155
  - LICENSE.txt
@@ -183,6 +205,7 @@ files:
183
205
  - spec/dummy/public/500.html
184
206
  - spec/dummy/public/favicon.ico
185
207
  - spec/lib/frikandel/configuration_spec.rb
208
+ - spec/rails_helper.rb
186
209
  - spec/spec_helper.rb
187
210
  - spec/support/application_controller.rb
188
211
  homepage: https://github.com/taktsoft/frikandel
@@ -197,55 +220,56 @@ required_ruby_version: !ruby/object:Gem::Requirement
197
220
  requirements:
198
221
  - - ">="
199
222
  - !ruby/object:Gem::Version
200
- version: '0'
223
+ version: 1.9.3
201
224
  required_rubygems_version: !ruby/object:Gem::Requirement
202
225
  requirements:
203
226
  - - ">="
204
227
  - !ruby/object:Gem::Version
205
- version: '0'
228
+ version: 1.3.6
206
229
  requirements: []
207
230
  rubyforge_project:
208
- rubygems_version: 2.2.2
231
+ rubygems_version: 2.4.8
209
232
  signing_key:
210
233
  specification_version: 4
211
234
  summary: This gem adds a ttl to the session cookie of your application.
212
235
  test_files:
213
236
  - spec/lib/frikandel/configuration_spec.rb
214
- - spec/spec_helper.rb
215
- - spec/controllers/bind_session_to_ip_address_controller_spec.rb
216
- - spec/controllers/combined_controller_spec.rb
217
- - spec/controllers/limit_session_lifetime_controller_spec.rb
218
- - spec/controllers/customized_on_invalid_session_controller_spec.rb
219
- - spec/support/application_controller.rb
220
- - spec/dummy/README.rdoc
221
- - spec/dummy/public/500.html
222
- - spec/dummy/public/favicon.ico
237
+ - spec/dummy/app/helpers/application_helper.rb
238
+ - spec/dummy/app/views/layouts/application.html.erb
239
+ - spec/dummy/app/controllers/application_controller.rb
240
+ - spec/dummy/app/assets/stylesheets/application.css
241
+ - spec/dummy/app/assets/javascripts/application.js
242
+ - spec/dummy/log/test.log
223
243
  - spec/dummy/public/422.html
244
+ - spec/dummy/public/favicon.ico
224
245
  - spec/dummy/public/404.html
225
- - spec/dummy/config.ru
226
- - spec/dummy/log/test.log
227
- - spec/dummy/config/boot.rb
246
+ - spec/dummy/public/500.html
247
+ - spec/dummy/README.rdoc
248
+ - spec/dummy/config/environment.rb
249
+ - spec/dummy/config/routes.rb
250
+ - spec/dummy/config/initializers/inflections.rb
251
+ - spec/dummy/config/initializers/backtrace_silencers.rb
228
252
  - spec/dummy/config/initializers/wrap_parameters.rb
229
- - spec/dummy/config/initializers/filter_parameter_logging.rb
230
253
  - spec/dummy/config/initializers/session_store.rb
231
254
  - spec/dummy/config/initializers/secret_token.rb
255
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
232
256
  - spec/dummy/config/initializers/mime_types.rb
233
- - spec/dummy/config/initializers/backtrace_silencers.rb
234
- - spec/dummy/config/initializers/inflections.rb
235
- - spec/dummy/config/locales/en.yml
236
- - spec/dummy/config/routes.rb
237
- - spec/dummy/config/environment.rb
238
257
  - spec/dummy/config/environments/production.rb
239
258
  - spec/dummy/config/environments/test.rb
240
259
  - spec/dummy/config/environments/development.rb
241
- - spec/dummy/config/database.yml
260
+ - spec/dummy/config/locales/en.yml
242
261
  - spec/dummy/config/application.rb
262
+ - spec/dummy/config/boot.rb
263
+ - spec/dummy/config/database.yml
264
+ - spec/dummy/config.ru
243
265
  - spec/dummy/bin/rails
244
- - spec/dummy/bin/bundle
245
266
  - spec/dummy/bin/rake
246
- - spec/dummy/app/assets/javascripts/application.js
247
- - spec/dummy/app/assets/stylesheets/application.css
248
- - spec/dummy/app/views/layouts/application.html.erb
249
- - spec/dummy/app/controllers/application_controller.rb
250
- - spec/dummy/app/helpers/application_helper.rb
267
+ - spec/dummy/bin/bundle
251
268
  - spec/dummy/Rakefile
269
+ - spec/spec_helper.rb
270
+ - spec/rails_helper.rb
271
+ - spec/support/application_controller.rb
272
+ - spec/controllers/bind_session_to_ip_address_controller_spec.rb
273
+ - spec/controllers/customized_on_invalid_session_controller_spec.rb
274
+ - spec/controllers/combined_controller_spec.rb
275
+ - spec/controllers/limit_session_lifetime_controller_spec.rb