ragamuffins 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +15 -5
  3. data/app/assets/javascripts/ragamuffins/application.js +13 -0
  4. data/app/assets/stylesheets/ragamuffins/application.css +15 -0
  5. data/app/controllers/ragamuffins/application_controller.rb +4 -0
  6. data/app/helpers/ragamuffins/application_helper.rb +4 -0
  7. data/app/models/test_model.rb +6 -0
  8. data/app/views/layouts/ragamuffins/application.html.erb +14 -0
  9. data/config/routes.rb +2 -0
  10. data/db/migrate/20140415030524_create_test_models.rb +9 -0
  11. data/lib/ragamuffins/engine.rb +7 -0
  12. data/lib/ragamuffins/models/active_record_model_extension.rb +1 -1
  13. data/lib/ragamuffins/version.rb +1 -1
  14. data/lib/ragamuffins.rb +1 -0
  15. data/spec/dummy/README.rdoc +28 -0
  16. data/spec/dummy/Rakefile +6 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  20. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  21. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/spec/dummy/bin/bundle +3 -0
  23. data/spec/dummy/bin/rails +4 -0
  24. data/spec/dummy/bin/rake +4 -0
  25. data/spec/dummy/config/application.rb +29 -0
  26. data/spec/dummy/config/boot.rb +5 -0
  27. data/spec/dummy/config/database.yml +25 -0
  28. data/spec/dummy/config/environment.rb +5 -0
  29. data/spec/dummy/config/environments/development.rb +37 -0
  30. data/spec/dummy/config/environments/production.rb +83 -0
  31. data/spec/dummy/config/environments/test.rb +39 -0
  32. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  33. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  34. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  35. data/spec/dummy/config/initializers/inflections.rb +16 -0
  36. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  37. data/spec/dummy/config/initializers/session_store.rb +3 -0
  38. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  39. data/spec/dummy/config/locales/en.yml +23 -0
  40. data/spec/dummy/config/routes.rb +4 -0
  41. data/spec/dummy/config/secrets.yml +22 -0
  42. data/spec/dummy/config.ru +4 -0
  43. data/spec/dummy/db/development.sqlite3 +0 -0
  44. data/spec/dummy/db/schema.rb +22 -0
  45. data/spec/dummy/db/test.sqlite3 +0 -0
  46. data/spec/dummy/log/development.log +10 -0
  47. data/spec/dummy/log/test.log +491 -0
  48. data/spec/dummy/public/404.html +67 -0
  49. data/spec/dummy/public/422.html +67 -0
  50. data/spec/dummy/public/500.html +66 -0
  51. data/spec/dummy/public/favicon.ico +0 -0
  52. data/spec/factories/test_models.rb +7 -0
  53. data/spec/models/test_model_spec.rb +81 -0
  54. data/spec/spec_helper.rb +48 -0
  55. metadata +141 -11
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,7 @@
1
+ # Read about factories at https://github.com/thoughtbot/factory_girl
2
+
3
+ FactoryGirl.define do
4
+ factory :test_model do
5
+ name "MyString"
6
+ end
7
+ end
@@ -0,0 +1,81 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe TestModel do
4
+
5
+
6
+ # I am new to Mocking. So just wanted to make sure that it worked like I expected it to.
7
+ describe "Mocking" do
8
+ let(:my_model) do
9
+ mock_model TestModel, id: 1,
10
+ name: "My Name",
11
+ about: "About Me"
12
+ end
13
+ it "assigns the ID" do
14
+ expect(my_model.id).to eq 1
15
+ end
16
+
17
+ it "assigns the name" do
18
+ expect(my_model.name).to eq "My Name"
19
+ end
20
+
21
+ it "assigns the about" do
22
+ expect(my_model.about).to eq "About Me"
23
+ end
24
+ end
25
+
26
+
27
+ describe "Deleted IDs" do
28
+ before :each do
29
+ @model1 = FactoryGirl.create(:test_model)
30
+ @model2 = FactoryGirl.create(:test_model)
31
+ end
32
+
33
+ context "When all the IDs are still there" do
34
+
35
+ it "returns an empty array if all ids still exist" do
36
+ expect(TestModel.show_deleted_ids([@model1.id])).to eq []
37
+ end
38
+
39
+ it "handles multiple ids in one query" do
40
+ visible_ids = [@model1.id, @model2.id]
41
+
42
+ expect(TestModel.show_deleted_ids(visible_ids)).to eq []
43
+ end
44
+
45
+ it "handles ids as strings" do
46
+ expect(TestModel.show_deleted_ids([@model1.id.to_s])).to eq []
47
+ end
48
+
49
+ it "can handle an array of mixed strings and integers" do
50
+ visible_ids = [@model1.id.to_s, @model2.id]
51
+
52
+ expect(TestModel.show_deleted_ids(visible_ids)).to eq []
53
+ end
54
+ end
55
+
56
+ context "When some ids have been deleted" do
57
+ before :each do
58
+ @deleted_id = @model2.id
59
+ @model2.destroy!
60
+ end
61
+
62
+ it "returns the deleted id" do
63
+ expect(TestModel.show_deleted_ids([@deleted_id])).to eq [@deleted_id]
64
+ end
65
+
66
+ it "Returns only the deleted ID" do
67
+ visible_ids = [@model1.id, @deleted_id]
68
+
69
+ expect(TestModel.show_deleted_ids(visible_ids)).to eq [@deleted_id]
70
+ end
71
+
72
+ it "returns a lot of IDS if needed" do
73
+ @other_deleted_id = @model1.id
74
+ @model1.destroy!
75
+
76
+ visible_ids = [@deleted_id, @other_deleted_id]
77
+ expect(TestModel.show_deleted_ids(visible_ids).length).to eq 2
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,48 @@
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
+ require 'rspec/rails'
5
+ require 'rspec/autorun'
6
+ require 'factory_girl_rails'
7
+
8
+ Rails.backtrace_cleaner.remove_silencers!
9
+
10
+ # Load Support files
11
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
12
+
13
+ # Requires supporting ruby files with custom matchers and macros, etc,
14
+ # in spec/support/ and its subdirectories.
15
+ # Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
16
+
17
+ # Checks for pending migrations before tests are run.
18
+ # If you are not using ActiveRecord, you can remove this line.
19
+ ActiveRecord::Migration.maintain_test_schema!
20
+
21
+ RSpec.configure do |config|
22
+ # ## Mock Framework
23
+ #
24
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
25
+ #
26
+ config.mock_with :rspec
27
+ # config.mock_with :flexmock
28
+ # config.mock_with :rr
29
+
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
+ # If true, the base class of anonymous controllers will be inferred
39
+ # automatically. This will be the default behavior in future versions of
40
+ # rspec-rails.
41
+ config.infer_base_class_for_anonymous_controllers = false
42
+
43
+ # Run specs in random order to surface order dependencies. If you find an
44
+ # order dependency and want to debug it, you can fix the order by providing
45
+ # the seed, which is printed after each run.
46
+ # --seed 1234
47
+ config.order = "random"
48
+ end
metadata CHANGED
@@ -1,41 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ragamuffins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Norman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-14 00:00:00.000000000 Z
11
+ date: 2014-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.1
19
+ version: 4.0.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
- version: 4.0.1
26
+ version: 4.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: capybara
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: factory_girl_rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
39
81
  - !ruby/object:Gem::Version
40
82
  version: '0'
41
83
  description: A simple gem for finding out which objects have been orphaned on your
@@ -49,6 +91,14 @@ files:
49
91
  - MIT-LICENSE
50
92
  - README.rdoc
51
93
  - Rakefile
94
+ - app/assets/javascripts/ragamuffins/application.js
95
+ - app/assets/stylesheets/ragamuffins/application.css
96
+ - app/controllers/ragamuffins/application_controller.rb
97
+ - app/helpers/ragamuffins/application_helper.rb
98
+ - app/models/test_model.rb
99
+ - app/views/layouts/ragamuffins/application.html.erb
100
+ - config/routes.rb
101
+ - db/migrate/20140415030524_create_test_models.rb
52
102
  - lib/ragamuffins.rb
53
103
  - lib/ragamuffins/engine.rb
54
104
  - lib/ragamuffins/hooks.rb
@@ -57,6 +107,46 @@ files:
57
107
  - lib/ragamuffins/railtie.rb
58
108
  - lib/ragamuffins/version.rb
59
109
  - lib/tasks/ragamuffins_tasks.rake
110
+ - spec/dummy/README.rdoc
111
+ - spec/dummy/Rakefile
112
+ - spec/dummy/app/assets/javascripts/application.js
113
+ - spec/dummy/app/assets/stylesheets/application.css
114
+ - spec/dummy/app/controllers/application_controller.rb
115
+ - spec/dummy/app/helpers/application_helper.rb
116
+ - spec/dummy/app/views/layouts/application.html.erb
117
+ - spec/dummy/bin/bundle
118
+ - spec/dummy/bin/rails
119
+ - spec/dummy/bin/rake
120
+ - spec/dummy/config.ru
121
+ - spec/dummy/config/application.rb
122
+ - spec/dummy/config/boot.rb
123
+ - spec/dummy/config/database.yml
124
+ - spec/dummy/config/environment.rb
125
+ - spec/dummy/config/environments/development.rb
126
+ - spec/dummy/config/environments/production.rb
127
+ - spec/dummy/config/environments/test.rb
128
+ - spec/dummy/config/initializers/backtrace_silencers.rb
129
+ - spec/dummy/config/initializers/cookies_serializer.rb
130
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
131
+ - spec/dummy/config/initializers/inflections.rb
132
+ - spec/dummy/config/initializers/mime_types.rb
133
+ - spec/dummy/config/initializers/session_store.rb
134
+ - spec/dummy/config/initializers/wrap_parameters.rb
135
+ - spec/dummy/config/locales/en.yml
136
+ - spec/dummy/config/routes.rb
137
+ - spec/dummy/config/secrets.yml
138
+ - spec/dummy/db/development.sqlite3
139
+ - spec/dummy/db/schema.rb
140
+ - spec/dummy/db/test.sqlite3
141
+ - spec/dummy/log/development.log
142
+ - spec/dummy/log/test.log
143
+ - spec/dummy/public/404.html
144
+ - spec/dummy/public/422.html
145
+ - spec/dummy/public/500.html
146
+ - spec/dummy/public/favicon.ico
147
+ - spec/factories/test_models.rb
148
+ - spec/models/test_model_spec.rb
149
+ - spec/spec_helper.rb
60
150
  homepage: http://www.github.com/RustComet/Ragamuffins
61
151
  licenses: []
62
152
  metadata: {}
@@ -66,12 +156,12 @@ require_paths:
66
156
  - lib
67
157
  required_ruby_version: !ruby/object:Gem::Requirement
68
158
  requirements:
69
- - - '>='
159
+ - - ">="
70
160
  - !ruby/object:Gem::Version
71
161
  version: '0'
72
162
  required_rubygems_version: !ruby/object:Gem::Requirement
73
163
  requirements:
74
- - - '>='
164
+ - - ">="
75
165
  - !ruby/object:Gem::Version
76
166
  version: '0'
77
167
  requirements: []
@@ -80,4 +170,44 @@ rubygems_version: 2.2.2
80
170
  signing_key:
81
171
  specification_version: 4
82
172
  summary: Find your orphans
83
- test_files: []
173
+ test_files:
174
+ - spec/dummy/app/assets/javascripts/application.js
175
+ - spec/dummy/app/assets/stylesheets/application.css
176
+ - spec/dummy/app/controllers/application_controller.rb
177
+ - spec/dummy/app/helpers/application_helper.rb
178
+ - spec/dummy/app/views/layouts/application.html.erb
179
+ - spec/dummy/bin/bundle
180
+ - spec/dummy/bin/rails
181
+ - spec/dummy/bin/rake
182
+ - spec/dummy/config/application.rb
183
+ - spec/dummy/config/boot.rb
184
+ - spec/dummy/config/database.yml
185
+ - spec/dummy/config/environment.rb
186
+ - spec/dummy/config/environments/development.rb
187
+ - spec/dummy/config/environments/production.rb
188
+ - spec/dummy/config/environments/test.rb
189
+ - spec/dummy/config/initializers/backtrace_silencers.rb
190
+ - spec/dummy/config/initializers/cookies_serializer.rb
191
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
192
+ - spec/dummy/config/initializers/inflections.rb
193
+ - spec/dummy/config/initializers/mime_types.rb
194
+ - spec/dummy/config/initializers/session_store.rb
195
+ - spec/dummy/config/initializers/wrap_parameters.rb
196
+ - spec/dummy/config/locales/en.yml
197
+ - spec/dummy/config/routes.rb
198
+ - spec/dummy/config/secrets.yml
199
+ - spec/dummy/config.ru
200
+ - spec/dummy/db/development.sqlite3
201
+ - spec/dummy/db/schema.rb
202
+ - spec/dummy/db/test.sqlite3
203
+ - spec/dummy/log/development.log
204
+ - spec/dummy/log/test.log
205
+ - spec/dummy/public/404.html
206
+ - spec/dummy/public/422.html
207
+ - spec/dummy/public/500.html
208
+ - spec/dummy/public/favicon.ico
209
+ - spec/dummy/Rakefile
210
+ - spec/dummy/README.rdoc
211
+ - spec/factories/test_models.rb
212
+ - spec/models/test_model_spec.rb
213
+ - spec/spec_helper.rb