self_systeem 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,33 @@
1
+ ---
2
+ :affirmations:
3
+ - :request_method: GET
4
+ :request_path: "/"
5
+ :action: index
6
+ :request_parameters:
7
+ controller: application
8
+ action: index
9
+ :controller_class_name: ApplicationController
10
+ :status: 200
11
+ :partials: {}
12
+ :layouts: {}
13
+ :templates: {}
14
+ :files: {}
15
+ :relevant_instance_varaibles: "[\"@current_user\"]"
16
+ :instance_variable_objects:
17
+ "@current_user": {id: }
18
+ - :request_method: GET
19
+ :request_path: "/users"
20
+ :action: index
21
+ :request_parameters:
22
+ controller: application
23
+ action: index
24
+ :controller_class_name: UsersController
25
+ :status: 200
26
+ :partials: {}
27
+ :layouts: {}
28
+ :templates:
29
+ users/index: 1
30
+ :files: {}
31
+ :relevant_instance_varaibles: "[\"@users\"]"
32
+ :instance_variable_objects:
33
+ "@users": {}
@@ -0,0 +1,20 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ # require File.expand_path("../../../../dummy_app/app/config/environment", __FILE__)
3
+ # require "cell/test_case"
4
+ require 'test_helper_dummy'
5
+ require "rails/test_help"
6
+ require "minitest/spec"
7
+ require "database_cleaner"
8
+ Dir[File.join("./test/support/**/authentication.rb")].sort.each { |f| require f }
9
+
10
+ DatabaseCleaner.strategy = :truncation
11
+ DatabaseCleaner.clean_with :truncation
12
+
13
+ class ActionController::TestCase
14
+ self.use_transactional_fixtures = false
15
+ end
16
+
17
+ module SysteemConfig
18
+ Affirmations = YAML.load_file("./test/dummy_tests/system/support/systeem_booster.yml")[:affirmations]
19
+ Session = ActionController::TestSession.new
20
+ end
@@ -0,0 +1,32 @@
1
+ require "./test/dummy_tests/system/support/systeem_config.rb"
2
+
3
+ describe "start_db_cleaner" do
4
+ it { DatabaseCleaner.start }
5
+ end
6
+
7
+ SysteemConfig::Affirmations.each do |a|
8
+ describe a[:controller_class_name].constantize do
9
+ before do
10
+ # Only needed if devise
11
+ # @request.env["devise.mapping"] = Devise.mappings[:user]
12
+ send(a[:request_method].downcase.to_sym, a[:action], a[:request_parameters], SysteemConfig::Session)
13
+ SysteemConfig::Session.merge! session
14
+ end
15
+
16
+ it {
17
+ controller_instance = response.request.env["action_controller.instance"] || @controller
18
+ builder = SelfSysteem::InstanceVariablesBuilder.call(controller_instance)
19
+ relevant_instance_varaibles = builder.relevant_instance_varaibles
20
+ instance_variable_objects = builder.instance_variable_objects
21
+
22
+ assert_response a[:status]
23
+ assert_equal(a[:relevant_instance_varaibles], relevant_instance_varaibles.to_s)
24
+ assert_equal(a[:instance_variable_objects], instance_variable_objects)
25
+ assert_equal(a[:templates], @_templates)
26
+ }
27
+ end
28
+ end
29
+
30
+ describe "db_cleaner_clean" do
31
+ it { DatabaseCleaner.clean }
32
+ end
@@ -0,0 +1,31 @@
1
+ module MiniTestSpecRails
2
+ module SharedTestCaseBehavior
3
+
4
+ extend ActiveSupport::Concern
5
+
6
+ included do
7
+ before { setup_dummy_schema }
8
+ let(:app) { Dummy::Application }
9
+ let(:user_ken) { User.create! :email => 'ken@metaskills.net' }
10
+ let(:user_post) { Post.create! :title => 'Test Title', :body => 'Test body. Test body.', :user => user_ken}
11
+ end
12
+
13
+ private
14
+
15
+ def setup_dummy_schema
16
+ ActiveRecord::Base.class_eval do
17
+ connection.instance_eval do
18
+ create_table :users, :force => true do |t|
19
+ t.string :email
20
+ end
21
+ create_table :posts, :force => true do |t|
22
+ t.string :title, :body
23
+ t.integer :user_id
24
+ end
25
+ end
26
+ end
27
+ end
28
+
29
+ end
30
+ end
31
+
@@ -0,0 +1,13 @@
1
+ require 'dummy_app/init'
2
+ require 'support/shared_test_case_behavior'
3
+ require "minitest-spec-rails"
4
+ require "pry"
5
+
6
+ module MiniTestSpecRails
7
+ class TestCase < MiniTest::Spec
8
+
9
+ include MiniTestSpecRails::SharedTestCaseBehavior
10
+
11
+
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ class ActiveSupport::TestCase
4
+
5
+ fixtures :all
6
+ include MiniTestSpecRails::SharedTestCaseBehavior
7
+
8
+
9
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: self_systeem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Piccolo
@@ -14,16 +14,44 @@ dependencies:
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: minitest
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '4.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '4.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: database_cleaner
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.2'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: bundler
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +66,76 @@ dependencies:
38
66
  - - "~>"
39
67
  - !ruby/object:Gem::Version
40
68
  version: '1.5'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest-spec-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.0'
41
83
  - !ruby/object:Gem::Dependency
42
84
  name: rake
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
- - - ">="
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
46
102
  - !ruby/object:Gem::Version
47
- version: '0'
103
+ version: '1.3'
48
104
  type: :development
49
105
  prerelease: false
50
106
  version_requirements: !ruby/object:Gem::Requirement
51
107
  requirements:
52
- - - ">="
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: pry
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '0.9'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '0.9'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-debugger
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.2'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
53
137
  - !ruby/object:Gem::Version
54
- version: '0'
138
+ version: '0.2'
55
139
  description: System testing by recording actual user interactions
56
140
  email:
57
141
  - mpiccolo@newleaders.com
@@ -72,6 +156,26 @@ files:
72
156
  - lib/self_systeem/instance_variables_builder.rb
73
157
  - lib/self_systeem/version.rb
74
158
  - self_systeem.gemspec
159
+ - test/dummy_app/app/controllers/application_controller.rb
160
+ - test/dummy_app/app/controllers/users_controller.rb
161
+ - test/dummy_app/app/helpers/application_helper.rb
162
+ - test/dummy_app/app/helpers/foos_helper.rb
163
+ - test/dummy_app/app/helpers/users_helper.rb
164
+ - test/dummy_app/app/mailers/user_mailer.rb
165
+ - test/dummy_app/app/models/post.rb
166
+ - test/dummy_app/app/models/user.rb
167
+ - test/dummy_app/app/views/users/index.html.erb
168
+ - test/dummy_app/config/database.yml
169
+ - test/dummy_app/config/routes.rb
170
+ - test/dummy_app/init.rb
171
+ - test/dummy_app/lib/library.rb
172
+ - test/dummy_app/log/test.log
173
+ - test/dummy_tests/system/support/systeem_booster.yml
174
+ - test/dummy_tests/system/support/systeem_config.rb
175
+ - test/dummy_tests/system/systeem_test.rb
176
+ - test/support/shared_test_case_behavior.rb
177
+ - test/test_helper.rb
178
+ - test/test_helper_dummy.rb
75
179
  homepage: ''
76
180
  licenses:
77
181
  - MIT
@@ -96,5 +200,25 @@ rubygems_version: 2.2.1
96
200
  signing_key:
97
201
  specification_version: 4
98
202
  summary: Unconfident in you system testing? Boost your Self Systeem.
99
- test_files: []
203
+ test_files:
204
+ - test/dummy_app/app/controllers/application_controller.rb
205
+ - test/dummy_app/app/controllers/users_controller.rb
206
+ - test/dummy_app/app/helpers/application_helper.rb
207
+ - test/dummy_app/app/helpers/foos_helper.rb
208
+ - test/dummy_app/app/helpers/users_helper.rb
209
+ - test/dummy_app/app/mailers/user_mailer.rb
210
+ - test/dummy_app/app/models/post.rb
211
+ - test/dummy_app/app/models/user.rb
212
+ - test/dummy_app/app/views/users/index.html.erb
213
+ - test/dummy_app/config/database.yml
214
+ - test/dummy_app/config/routes.rb
215
+ - test/dummy_app/init.rb
216
+ - test/dummy_app/lib/library.rb
217
+ - test/dummy_app/log/test.log
218
+ - test/dummy_tests/system/support/systeem_booster.yml
219
+ - test/dummy_tests/system/support/systeem_config.rb
220
+ - test/dummy_tests/system/systeem_test.rb
221
+ - test/support/shared_test_case_behavior.rb
222
+ - test/test_helper.rb
223
+ - test/test_helper_dummy.rb
100
224
  has_rdoc: