rspeckled 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f6d8f190842502239c8a8bd0b939ee121e58d3a
4
- data.tar.gz: 275b354e314d7913e05c9348e84af3304e143d06
3
+ metadata.gz: 98403eadd91a6ec563587a4949c4632573c29e3f
4
+ data.tar.gz: 7ec2e31f96d027e8760f4294185c9583036d496e
5
5
  SHA512:
6
- metadata.gz: d1685b80905b566f6635e59e41a9fee5a9546321aee3af27b31ff365b2d5b449ec05dcb8d27408c6a4dd507f60c8aed155e0b5866f5bfa3a507601628b98ef58
7
- data.tar.gz: 2cefeb604bbb8a64ba93a7a10a7c49500c01a99e0c5002b9d3a4088235a9310e91ea38aaca9339144fb12069c66607f444c3deaaad2096f4c19982e79f05c5f6
6
+ metadata.gz: 4b19ececf090c791f094ac62744dfe1327aaa2d39c5e993496167c81ee2b70fb4e3b3c7875d61a636683335aaf22fc5adceb3c6d97e4011dd7f23f389574d407
7
+ data.tar.gz: 4887881a25f933d78aabcd88262fb901e7769b1fb69358e9b5c129ddad5dc7469835c8cfd431cf38b9dd17afa2dd49c3c492ac177034f6400129075ec3459b8f
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,4 @@
1
1
  require 'rspeckled/helpers/factories'
2
2
  require 'rspeckled/helpers/null_objects'
3
- require 'rspeckled/helpers/session_helpers'
3
+ require 'rspeckled/helpers/patterns'
4
+ require 'rspeckled/helpers/responses'
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ def uuid_regex
3
+ /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/
4
+ end
5
+
6
+ def guid_regex
7
+ /[a-f0-9]{32}/
8
+ end
9
+
10
+ def sha_regex
11
+ /[a-f0-9]{64}/
12
+ end
13
+
14
+ def test_email_regex
15
+ /user\d+@example.com/
16
+ end
17
+
18
+ def test_username_regex
19
+ /username\d+/
20
+ end
21
+
22
+ def json_web_token_base64_regex
23
+ %r{[A-Za-z0-9_/\+\=\-]}
24
+ end
25
+
26
+ def json_web_token_regex
27
+ /
28
+ \A
29
+ (#{json_web_token_base64_regex}+?\.){4}
30
+ #{json_web_token_base64_regex}+?
31
+ \z
32
+ /x
33
+ end
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ require 'json'
3
+
4
+ def json_response
5
+ JSON.load(response.body)
6
+ end
@@ -1,5 +1,6 @@
1
1
  require 'rspeckled/plugins/timecop'
2
2
  require 'rspeckled/plugins/authentication'
3
+ require 'rspeckled/plugins/awesome_print'
3
4
  require 'rspeckled/plugins/bullet'
4
5
  require 'rspeckled/plugins/carrier_wave'
5
6
  require 'rspeckled/plugins/database_cleaner'
@@ -23,7 +23,7 @@ RSpec.configure do |config|
23
23
  downcase
24
24
 
25
25
  current_class_method = if options.is_a?(Hash) && options[:method]
26
- options[:method]
26
+ options[:method] || :current_user
27
27
  else
28
28
  :"current_#{underscored_class_name}"
29
29
  end
@@ -86,7 +86,7 @@ RSpec.configure do |config|
86
86
  'iat' => Time.now.utc.to_i,
87
87
  'jti' => SecureRandom.uuid,
88
88
  'sid' => instance['account_id'] || instance['id'],
89
- 'rol' => options[:role] || 'basic',
89
+ 'rol' => options[:roles] || 'standard',
90
90
  },
91
91
  {
92
92
  'typ' => 'JWT',
@@ -0,0 +1,32 @@
1
+ ##############################################################################
2
+ # Awesome Print Plugin
3
+ ##############################################################################
4
+
5
+ begin
6
+ require 'awesome_print'
7
+
8
+ module Kernel
9
+ def sap(msg)
10
+ puts
11
+ puts
12
+ ap "************************** #{Time.now} **************************", :color => { :string => :white }
13
+ puts
14
+ ap(msg.class, :color => { :class => :yellowish }) if msg.respond_to?(:class)
15
+ puts
16
+ root_path = defined?(Rails) ? Rails.root.to_s : ''
17
+
18
+ lines = caller[0...3].map do |line|
19
+ line.gsub(root_path + '/', '')
20
+ end
21
+
22
+ lines.each { |line| ap line, :color => { :string => :purpleish } }
23
+ puts
24
+ ap msg
25
+ puts
26
+ ap '************************************* END **************************************', :color => { :string => :white }
27
+ puts
28
+ puts
29
+ end
30
+ end
31
+ rescue LoadError
32
+ end
@@ -12,16 +12,21 @@ begin
12
12
  require 'email_spec'
13
13
 
14
14
  RSpec.configure do |config|
15
- config.include EmailSpec::Helpers, :email => true
16
- config.include EmailSpec::Matchers, :email => true
15
+ config.include EmailSpec::Helpers, :email => true
16
+ config.include EmailSpec::Matchers, :email => true
17
+ config.include EmailSpec::MailerDeliveries, :email => true
17
18
  end
18
19
  rescue LoadError
19
20
  end
20
21
 
21
22
  if defined? ActionMailer
22
23
  RSpec.configure do |config|
23
- config.after(:each, :email => true) do
24
- ActionMailer::Base.deliveries.clear
24
+ config.before(:each, :email => true) do
25
+ if defined?(ActionMailer) && ActionMailer::Base.delivery_method == :cache
26
+ mailer.clear_cache
27
+ else
28
+ deliveries.clear
29
+ end
25
30
  end
26
31
  end
27
32
  end
@@ -4,10 +4,12 @@
4
4
 
5
5
  begin
6
6
  require 'shoulda-matchers'
7
- rescue LoadError
8
- end
9
7
 
10
- if defined? Shoulda
8
+ RSpec.configure do |config|
9
+ config.include(Shoulda::Matchers::ActiveModel, :type => :model)
10
+ config.include(Shoulda::Matchers::ActiveRecord, :type => :model)
11
+ end
12
+
11
13
  Shoulda::Matchers.configure do |config|
12
14
  config.integrate do |with|
13
15
  with.test_framework :rspec
@@ -37,4 +39,5 @@ if defined? Shoulda
37
39
  end
38
40
  end
39
41
  end
42
+ rescue LoadError
40
43
  end
@@ -1,3 +1,3 @@
1
1
  module Rspeckled
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspeckled
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - thegranddesign
@@ -31,7 +31,7 @@ cert_chain:
31
31
  zRIv8lqQM8QFT76rzP5SBCERwN+ltKAFbQ5/FwmZNGWYnmCP3RZMQiRnbh+9H9lh
32
32
  mlbwaYZTjgsXq6cy8N38EecewgBbZYS1IYJraE/M
33
33
  -----END CERTIFICATE-----
34
- date: 2016-05-01 00:00:00.000000000 Z
34
+ date: 2016-05-11 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
@@ -89,13 +89,15 @@ files:
89
89
  - lib/rspeckled/helpers.rb
90
90
  - lib/rspeckled/helpers/factories.rb
91
91
  - lib/rspeckled/helpers/null_objects.rb
92
- - lib/rspeckled/helpers/session_helpers.rb
92
+ - lib/rspeckled/helpers/patterns.rb
93
+ - lib/rspeckled/helpers/responses.rb
93
94
  - lib/rspeckled/mock_authentications/omniauth.rb
94
95
  - lib/rspeckled/mock_authentications/omniauth/ebay.rb
95
96
  - lib/rspeckled/mock_authentications/omniauth/facebook.rb
96
97
  - lib/rspeckled/mock_authentications/omniauth/twitter.rb
97
98
  - lib/rspeckled/plugins.rb
98
99
  - lib/rspeckled/plugins/authentication.rb
100
+ - lib/rspeckled/plugins/awesome_print.rb
99
101
  - lib/rspeckled/plugins/bullet.rb
100
102
  - lib/rspeckled/plugins/carrier_wave.rb
101
103
  - lib/rspeckled/plugins/code_climate.rb
@@ -133,7 +135,6 @@ files:
133
135
  - lib/rspeckled/support/garbage_collection.rb
134
136
  - lib/rspeckled/support/heroku.rb
135
137
  - lib/rspeckled/support/i18n.rb
136
- - lib/rspeckled/support/misc.rb
137
138
  - lib/rspeckled/support/mocks.rb
138
139
  - lib/rspeckled/support/output.rb
139
140
  - lib/rspeckled/support/pending.rb
metadata.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ��
2
- B_7H���JŊ`���?���6i Y�%���ͥ�Ɛ�+����e��RM�{[��H?��}��+N-�&kT'�ƩBlO���'>`i���
1
+ ���W��F������mW�/�Ң�
2
+ �������N$@�o3E��1Tu ��P�#�/�Dq&��{T���fT eK�B�ژM���&!�A��ee҂�-�Y]3��1 #ێ�e�х��
3
+ ��}������F#O���d<4mA�B�ܧ:���y�&�a�h4��� \ɝ��bֶEn˓�(��ly��g�|�5`C����!�.?Y<F�w�tA��)8��?{ 18-�]�Cr��%��n�sί$�d�1#
@@ -1,5 +0,0 @@
1
- def authenticate_api_as(user)
2
- auth_token = user.respond_to?(:auth_token) ? user.auth_token : user
3
-
4
- request.env['HTTP_AUTHORIZATION'] = "Token #{auth_token}"
5
- end
@@ -1 +0,0 @@
1
- RSpec.configure(&:disable_monkey_patching!)