pillowfort 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -1
- data/app/models/pillowfort/concerns/model_authentication.rb +7 -3
- data/lib/pillowfort/version.rb +1 -1
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/accounts.js +2 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/accounts.css +4 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/accounts_controller.rb +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/accounts_helper.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/account.rb +3 -0
- data/spec/dummy/app/views/accounts/index.html.erb +2 -0
- data/spec/dummy/app/views/accounts/show.html.erb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +31 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +17 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +60 -0
- data/spec/dummy/config/secrets.yml +14 -0
- data/spec/dummy/db/migrate/20150127045508_create_accounts.rb +12 -0
- data/spec/dummy/db/schema.rb +25 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +2087 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/controllers/accounts_controller_spec.rb +52 -0
- data/spec/dummy/spec/factories/accounts.rb +10 -0
- data/spec/dummy/spec/models/account_spec.rb +276 -0
- data/spec/dummy/spec/rails_helper.rb +52 -0
- data/spec/dummy/spec/spec_helper.rb +85 -0
- data/spec/dummy/spec/support/helpers/authentication_helper.rb +15 -0
- metadata +103 -3
@@ -0,0 +1,52 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
5
|
+
require 'rspec/rails'
|
6
|
+
require 'factory_girl_rails'
|
7
|
+
|
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
|
+
# Checks for pending migrations before tests are run.
|
26
|
+
# If you are not using ActiveRecord, you can remove this line.
|
27
|
+
ActiveRecord::Migration.maintain_test_schema!
|
28
|
+
|
29
|
+
RSpec.configure do |config|
|
30
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
31
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
32
|
+
|
33
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
34
|
+
# examples within a transaction, remove the following line or assign false
|
35
|
+
# instead of true.
|
36
|
+
config.use_transactional_fixtures = true
|
37
|
+
|
38
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
39
|
+
# based on their file location, for example enabling you to call `get` and
|
40
|
+
# `post` in specs under `spec/controllers`.
|
41
|
+
#
|
42
|
+
# You can disable this behaviour by removing the line below, and instead
|
43
|
+
# explicitly tag your specs with their type, e.g.:
|
44
|
+
#
|
45
|
+
# RSpec.describe UsersController, :type => :controller do
|
46
|
+
# # ...
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# The different available types are documented in the features, such as in
|
50
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
51
|
+
config.infer_spec_type_from_file_location!
|
52
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
5
|
+
#
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
9
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
10
|
+
# a separate helper file that requires the additional dependencies and performs
|
11
|
+
# the additional setup, and require it from the spec files that actually need it.
|
12
|
+
#
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
14
|
+
# users commonly want.
|
15
|
+
#
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
17
|
+
RSpec.configure do |config|
|
18
|
+
# rspec-expectations config goes here. You can use an alternate
|
19
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
20
|
+
# assertions if you prefer.
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
23
|
+
# and `failure_message` of custom matchers include text for helper methods
|
24
|
+
# defined using `chain`, e.g.:
|
25
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
26
|
+
# # => "be bigger than 2 and smaller than 4"
|
27
|
+
# ...rather than:
|
28
|
+
# # => "be bigger than 2"
|
29
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
30
|
+
end
|
31
|
+
|
32
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
33
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
34
|
+
config.mock_with :rspec do |mocks|
|
35
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
36
|
+
# a real object. This is generally recommended, and will default to
|
37
|
+
# `true` in RSpec 4.
|
38
|
+
mocks.verify_partial_doubles = true
|
39
|
+
end
|
40
|
+
|
41
|
+
# The settings below are suggested to provide a good initial experience
|
42
|
+
# with RSpec, but feel free to customize to your heart's content.
|
43
|
+
=begin
|
44
|
+
# These two settings work together to allow you to limit a spec run
|
45
|
+
# to individual examples or groups you care about by tagging them with
|
46
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
47
|
+
# get run.
|
48
|
+
config.filter_run :focus
|
49
|
+
config.run_all_when_everything_filtered = true
|
50
|
+
|
51
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
52
|
+
# For more details, see:
|
53
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
54
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
55
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
56
|
+
config.disable_monkey_patching!
|
57
|
+
|
58
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
59
|
+
# file, and it's useful to allow more verbose output when running an
|
60
|
+
# individual spec file.
|
61
|
+
if config.files_to_run.one?
|
62
|
+
# Use the documentation formatter for detailed output,
|
63
|
+
# unless a formatter has already been configured
|
64
|
+
# (e.g. via a command-line flag).
|
65
|
+
config.default_formatter = 'doc'
|
66
|
+
end
|
67
|
+
|
68
|
+
# Print the 10 slowest examples and example groups at the
|
69
|
+
# end of the spec run, to help surface which specs are running
|
70
|
+
# particularly slow.
|
71
|
+
config.profile_examples = 10
|
72
|
+
|
73
|
+
# Run specs in random order to surface order dependencies. If you find an
|
74
|
+
# order dependency and want to debug it, you can fix the order by providing
|
75
|
+
# the seed, which is printed after each run.
|
76
|
+
# --seed 1234
|
77
|
+
config.order = :random
|
78
|
+
|
79
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
80
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
81
|
+
# test failures related to randomization by passing the same `--seed` value
|
82
|
+
# as the one that triggered the failure.
|
83
|
+
Kernel.srand config.seed
|
84
|
+
=end
|
85
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module AuthenticationHelper
|
2
|
+
def authenticate_with(account)
|
3
|
+
return unless account
|
4
|
+
|
5
|
+
email = account.email
|
6
|
+
token = account.auth_token
|
7
|
+
|
8
|
+
request.env['HTTP_AUTHORIZATION'] =
|
9
|
+
ActionController::HttpAuthentication::Basic.encode_credentials(email, token)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec.configure do |config|
|
14
|
+
config.include AuthenticationHelper, :type => :controller
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pillowfort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Lowrimore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -98,6 +98,56 @@ files:
|
|
98
98
|
- lib/pillowfort/pillow_fight.rb
|
99
99
|
- lib/pillowfort/version.rb
|
100
100
|
- lib/tasks/pillowfort_tasks.rake
|
101
|
+
- spec/dummy/README.rdoc
|
102
|
+
- spec/dummy/Rakefile
|
103
|
+
- spec/dummy/app/assets/javascripts/accounts.js
|
104
|
+
- spec/dummy/app/assets/javascripts/application.js
|
105
|
+
- spec/dummy/app/assets/stylesheets/accounts.css
|
106
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
107
|
+
- spec/dummy/app/controllers/accounts_controller.rb
|
108
|
+
- spec/dummy/app/controllers/application_controller.rb
|
109
|
+
- spec/dummy/app/helpers/accounts_helper.rb
|
110
|
+
- spec/dummy/app/helpers/application_helper.rb
|
111
|
+
- spec/dummy/app/models/account.rb
|
112
|
+
- spec/dummy/app/views/accounts/index.html.erb
|
113
|
+
- spec/dummy/app/views/accounts/show.html.erb
|
114
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
115
|
+
- spec/dummy/bin/bundle
|
116
|
+
- spec/dummy/bin/rails
|
117
|
+
- spec/dummy/bin/rake
|
118
|
+
- spec/dummy/bin/setup
|
119
|
+
- spec/dummy/config.ru
|
120
|
+
- spec/dummy/config/application.rb
|
121
|
+
- spec/dummy/config/boot.rb
|
122
|
+
- spec/dummy/config/database.yml
|
123
|
+
- spec/dummy/config/environment.rb
|
124
|
+
- spec/dummy/config/environments/test.rb
|
125
|
+
- spec/dummy/config/initializers/assets.rb
|
126
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
127
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
128
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
129
|
+
- spec/dummy/config/initializers/inflections.rb
|
130
|
+
- spec/dummy/config/initializers/mime_types.rb
|
131
|
+
- spec/dummy/config/initializers/session_store.rb
|
132
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
133
|
+
- spec/dummy/config/locales/en.yml
|
134
|
+
- spec/dummy/config/routes.rb
|
135
|
+
- spec/dummy/config/secrets.yml
|
136
|
+
- spec/dummy/db/migrate/20150127045508_create_accounts.rb
|
137
|
+
- spec/dummy/db/schema.rb
|
138
|
+
- spec/dummy/db/test.sqlite3
|
139
|
+
- spec/dummy/log/development.log
|
140
|
+
- spec/dummy/log/test.log
|
141
|
+
- spec/dummy/public/404.html
|
142
|
+
- spec/dummy/public/422.html
|
143
|
+
- spec/dummy/public/500.html
|
144
|
+
- spec/dummy/public/favicon.ico
|
145
|
+
- spec/dummy/spec/controllers/accounts_controller_spec.rb
|
146
|
+
- spec/dummy/spec/factories/accounts.rb
|
147
|
+
- spec/dummy/spec/models/account_spec.rb
|
148
|
+
- spec/dummy/spec/rails_helper.rb
|
149
|
+
- spec/dummy/spec/spec_helper.rb
|
150
|
+
- spec/dummy/spec/support/helpers/authentication_helper.rb
|
101
151
|
homepage: https://github.com/coroutine/pillowfort
|
102
152
|
licenses:
|
103
153
|
- MIT
|
@@ -122,4 +172,54 @@ rubygems_version: 2.4.5
|
|
122
172
|
signing_key:
|
123
173
|
specification_version: 4
|
124
174
|
summary: Opinionated, session-less API authentication
|
125
|
-
test_files:
|
175
|
+
test_files:
|
176
|
+
- spec/dummy/app/assets/javascripts/accounts.js
|
177
|
+
- spec/dummy/app/assets/javascripts/application.js
|
178
|
+
- spec/dummy/app/assets/stylesheets/accounts.css
|
179
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
180
|
+
- spec/dummy/app/controllers/accounts_controller.rb
|
181
|
+
- spec/dummy/app/controllers/application_controller.rb
|
182
|
+
- spec/dummy/app/helpers/accounts_helper.rb
|
183
|
+
- spec/dummy/app/helpers/application_helper.rb
|
184
|
+
- spec/dummy/app/models/account.rb
|
185
|
+
- spec/dummy/app/views/accounts/index.html.erb
|
186
|
+
- spec/dummy/app/views/accounts/show.html.erb
|
187
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
188
|
+
- spec/dummy/bin/bundle
|
189
|
+
- spec/dummy/bin/rails
|
190
|
+
- spec/dummy/bin/rake
|
191
|
+
- spec/dummy/bin/setup
|
192
|
+
- spec/dummy/config/application.rb
|
193
|
+
- spec/dummy/config/boot.rb
|
194
|
+
- spec/dummy/config/database.yml
|
195
|
+
- spec/dummy/config/environment.rb
|
196
|
+
- spec/dummy/config/environments/test.rb
|
197
|
+
- spec/dummy/config/initializers/assets.rb
|
198
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
199
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
200
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
201
|
+
- spec/dummy/config/initializers/inflections.rb
|
202
|
+
- spec/dummy/config/initializers/mime_types.rb
|
203
|
+
- spec/dummy/config/initializers/session_store.rb
|
204
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
205
|
+
- spec/dummy/config/locales/en.yml
|
206
|
+
- spec/dummy/config/routes.rb
|
207
|
+
- spec/dummy/config/secrets.yml
|
208
|
+
- spec/dummy/config.ru
|
209
|
+
- spec/dummy/db/migrate/20150127045508_create_accounts.rb
|
210
|
+
- spec/dummy/db/schema.rb
|
211
|
+
- spec/dummy/db/test.sqlite3
|
212
|
+
- spec/dummy/log/development.log
|
213
|
+
- spec/dummy/log/test.log
|
214
|
+
- spec/dummy/public/404.html
|
215
|
+
- spec/dummy/public/422.html
|
216
|
+
- spec/dummy/public/500.html
|
217
|
+
- spec/dummy/public/favicon.ico
|
218
|
+
- spec/dummy/Rakefile
|
219
|
+
- spec/dummy/README.rdoc
|
220
|
+
- spec/dummy/spec/controllers/accounts_controller_spec.rb
|
221
|
+
- spec/dummy/spec/factories/accounts.rb
|
222
|
+
- spec/dummy/spec/models/account_spec.rb
|
223
|
+
- spec/dummy/spec/rails_helper.rb
|
224
|
+
- spec/dummy/spec/spec_helper.rb
|
225
|
+
- spec/dummy/spec/support/helpers/authentication_helper.rb
|