catarse_monkeymail 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rspec +2 -0
  4. data/Gemfile +0 -4
  5. data/Gemfile.lock +19 -451
  6. data/Rakefile +1 -1
  7. data/app/models/catarse_monkeymail/user_concern.rb +0 -1
  8. data/catarse_monkeymail.gemspec +3 -1
  9. data/lib/catarse_monkeymail/version.rb +1 -1
  10. data/spec/controller/catarse_monkeymail/controller_concerns_spec.rb +14 -0
  11. data/spec/dummy/README.rdoc +261 -0
  12. data/spec/dummy/Rakefile +7 -0
  13. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  14. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  16. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  17. data/spec/dummy/app/mailers/.gitkeep +0 -0
  18. data/spec/dummy/app/models/.gitkeep +0 -0
  19. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  20. data/spec/dummy/config.ru +4 -0
  21. data/spec/dummy/config/application.rb +23 -0
  22. data/spec/dummy/config/boot.rb +10 -0
  23. data/spec/dummy/config/database.yml +50 -0
  24. data/spec/dummy/config/environment.rb +5 -0
  25. data/spec/dummy/config/environments/development.rb +29 -0
  26. data/spec/dummy/config/environments/production.rb +80 -0
  27. data/spec/dummy/config/environments/test.rb +36 -0
  28. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  29. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  30. data/spec/dummy/config/initializers/inflections.rb +16 -0
  31. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  32. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  33. data/spec/dummy/config/initializers/session_store.rb +3 -0
  34. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  35. data/spec/dummy/config/locales/en.yml +5 -0
  36. data/spec/dummy/config/routes.rb +2 -0
  37. data/spec/dummy/lib/assets/.gitkeep +0 -0
  38. data/spec/dummy/log/.gitkeep +0 -0
  39. data/spec/dummy/public/404.html +26 -0
  40. data/spec/dummy/public/422.html +26 -0
  41. data/spec/dummy/public/500.html +25 -0
  42. data/spec/dummy/public/favicon.ico +0 -0
  43. data/spec/dummy/script/rails +6 -0
  44. data/spec/dummy/tmp/cache/A5C/C50/%2Fconfigurations%2Fa_config +1 -0
  45. data/spec/dummy/tmp/cache/C1D/B20/%2Fconfigurations%2Fother_config +1 -0
  46. data/spec/dummy/tmp/cache/DC7/960/%2Fconfigurations%2Fnot_found_config +1 -0
  47. data/spec/models/catarse_monkeymail/project_spec.rb +11 -11
  48. data/spec/models/catarse_monkeymail/user_spec.rb +14 -14
  49. data/spec/spec_helper.rb +16 -78
  50. data/spec/support/project.rb +3 -0
  51. data/spec/support/user.rb +2 -0
  52. metadata +112 -8
  53. data/app/controllers/catarse_monkeymail/application_controller.rb +0 -4
  54. data/bin/rails +0 -12
data/spec/spec_helper.rb CHANGED
@@ -1,42 +1,31 @@
1
1
  # This file is copied to spec/ when you run 'rails generate rspec:install'
2
2
  ENV["RAILS_ENV"] ||= 'test'
3
- require 'coveralls'
4
- Coveralls.wear!('rails')
5
3
 
6
- require File.expand_path("../dummy/config/environment", __FILE__)
7
- require 'rspec/rails'
8
- require 'sidekiq/testing'
9
- require 'fakeweb'
10
- require "pundit/rspec"
4
+ require 'active_record'
5
+ require 'rails/observers/active_model'
6
+ require 'rails/observers/activerecord/observer'
11
7
 
12
- ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
8
+ require 'mailchimp'
9
+ require 'support/user'
10
+ require 'support/project'
13
11
 
12
+ require File.expand_path("../dummy/config/environment", __FILE__)
13
+
14
+ require 'rspec/rails'
14
15
  # Requires supporting ruby files with custom matchers and macros, etc,
15
16
  # in spec/support/ and its subdirectories.
16
- Dir[Rails.root.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f}
17
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
17
18
 
18
- def fixture_path(basename)
19
- "spec/fixtures/#{basename}"
20
- end
21
-
22
-
23
- # Checks for pending migrations before tests are run.
24
- # If you are not using ActiveRecord, you can remove this line.
25
- ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
19
+ Project.observers = CatarseMonkeymail::MonkeyProjectObserver
20
+ Project.instantiate_observers
26
21
 
27
22
  RSpec.configure do |config|
28
- config.include FactoryGirl::Syntax::Methods
29
- config.include ActionView::Helpers::TextHelper
30
-
31
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
32
- # examples within a transaction, remove the following line or assign false
33
- # instead of true.
34
- config.use_transactional_fixtures = false
23
+ config.use_transactional_examples = true
35
24
 
36
25
  # If true, the base class of anonymous controllers will be inferred
37
26
  # automatically. This will be the default behavior in future versions of
38
27
  # rspec-rails.
39
- #config.infer_base_class_for_anonymous_controllers = false
28
+ config.infer_base_class_for_anonymous_controllers = false
40
29
 
41
30
  # Run specs in random order to surface order dependencies. If you find an
42
31
  # order dependency and want to debug it, you can fix the order by providing
@@ -44,59 +33,8 @@ RSpec.configure do |config|
44
33
  # --seed 1234
45
34
  config.order = "random"
46
35
 
47
- config.before(:suite) do
48
- ActiveRecord::Base.connection.execute "SET client_min_messages TO warning;"
49
- ActiveRecord::Base.connection.execute "SET timezone TO 'utc';"
50
- DatabaseCleaner.clean_with :truncation
51
- I18n.locale = :pt
52
- I18n.default_locale = :pt
53
-
54
- FakeWeb.register_uri(:get, "http://vimeo.com/api/v2/video/17298435.json", response: fixture_path('vimeo_default_json_request.txt'))
55
- FakeWeb.register_uri(:get, "http://vimeo.com/17298435", response: fixture_path('vimeo_default_request.txt'))
56
- FakeWeb.register_uri(:get, "http://www.youtube.com/watch?v=Brw7bzU_t4c", response: fixture_path("youtube_request.txt"))
57
- end
58
-
59
- config.before(:each) do
60
- if example.metadata[:type] == :feature
61
- DatabaseCleaner.strategy = :truncation
62
- else
63
- DatabaseCleaner.strategy = :transaction
64
- end
65
- DatabaseCleaner.start
66
- ActionMailer::Base.deliveries.clear
67
- RoutingFilter.active = false # Because this issue: https://github.com/svenfuchs/routing-filter/issues/36
68
- Sidekiq::Testing.fake!
69
- end
70
-
71
- config.after(:each) do
72
- DatabaseCleaner.clean
73
- end
74
-
75
- [:controller, :feature].each do |spec_type|
76
- config.before(:each, type: spec_type) do
77
- [:detect_old_browsers, :render_facebook_sdk, :render_facebook_like, :render_twitter, :display_uservoice_sso].each do |method|
78
- ApplicationController.any_instance.stub(method)
79
- end
80
- end
81
- end
82
-
83
- # Stubs and configuration
84
- config.before(:each) do
85
- CatarseMonkeymail::MailchimpApi.stub(:start)
86
-
87
-
88
- Project.any_instance.stub(:store_image_url).and_return('http://www.store_image_url.com')
89
- ProjectObserver.any_instance.stub(:after_create)
90
- UserObserver.any_instance.stub(:after_create)
91
- Project.any_instance.stub(:download_video_thumbnail)
92
- Notification.stub(:notify)
93
- Notification.stub(:notify_once)
94
- Calendar.any_instance.stub(:fetch_events_from)
95
- Blog.stub(:fetch_last_posts).and_return([])
96
- CatarseSettings[:base_domain] = 'localhost'
97
- CatarseSettings[:email_contact] = 'foo@bar.com'
98
- CatarseSettings[:company_name] = 'Foo Bar Company'
99
- Contribution.any_instance.stub(:payment_engine).and_return(PaymentEngines::Interface.new)
36
+ config.expect_with :rspec do |c|
37
+ c.syntax = :expect
100
38
  end
101
39
  end
102
40
 
@@ -0,0 +1,3 @@
1
+ class Project < ActiveRecord::Base
2
+ include ActiveModel::Observing
3
+ end
@@ -0,0 +1,2 @@
1
+ class User < ActiveRecord::Base
2
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: catarse_monkeymail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antônio Roberto Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-06 00:00:00.000000000 Z
11
+ date: 2014-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -39,7 +39,35 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 2.0.4
41
41
  - !ruby/object:Gem::Dependency
42
- name: sqlite3
42
+ name: rails-observers
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
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: rspec-rails
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: pg
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
73
  - - ">="
@@ -55,25 +83,23 @@ dependencies:
55
83
  description: A new catarse integration with mailchimp
56
84
  email:
57
85
  - ton@catarse.me
58
- executables:
59
- - rails
86
+ executables: []
60
87
  extensions: []
61
88
  extra_rdoc_files: []
62
89
  files:
63
90
  - ".gitignore"
64
91
  - ".gitmodules"
92
+ - ".rspec"
65
93
  - Gemfile
66
94
  - Gemfile.lock
67
95
  - MIT-LICENSE
68
96
  - README.md
69
97
  - Rakefile
70
- - app/controllers/catarse_monkeymail/application_controller.rb
71
98
  - app/controllers/catarse_monkeymail/controller_concerns.rb
72
99
  - app/models/catarse_monkeymail/mailchimp_api.rb
73
100
  - app/models/catarse_monkeymail/project_concern.rb
74
101
  - app/models/catarse_monkeymail/user_concern.rb
75
102
  - app/observers/catarse_monkeymail/monkey_project_observer.rb
76
- - bin/rails
77
103
  - catarse_monkeymail.gemspec
78
104
  - config/routes.rb
79
105
  - lib/catarse_monkeymail.rb
@@ -81,9 +107,48 @@ files:
81
107
  - lib/catarse_monkeymail/engine.rb
82
108
  - lib/catarse_monkeymail/version.rb
83
109
  - lib/tasks/catarse_monkeymail_tasks.rake
110
+ - spec/controller/catarse_monkeymail/controller_concerns_spec.rb
111
+ - spec/dummy/README.rdoc
112
+ - spec/dummy/Rakefile
113
+ - spec/dummy/app/assets/javascripts/application.js
114
+ - spec/dummy/app/assets/stylesheets/application.css
115
+ - spec/dummy/app/controllers/application_controller.rb
116
+ - spec/dummy/app/helpers/application_helper.rb
117
+ - spec/dummy/app/mailers/.gitkeep
118
+ - spec/dummy/app/models/.gitkeep
119
+ - spec/dummy/app/views/layouts/application.html.erb
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/filter_parameter_logging.rb
130
+ - spec/dummy/config/initializers/inflections.rb
131
+ - spec/dummy/config/initializers/mime_types.rb
132
+ - spec/dummy/config/initializers/secret_token.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/lib/assets/.gitkeep
138
+ - spec/dummy/log/.gitkeep
139
+ - spec/dummy/public/404.html
140
+ - spec/dummy/public/422.html
141
+ - spec/dummy/public/500.html
142
+ - spec/dummy/public/favicon.ico
143
+ - spec/dummy/script/rails
144
+ - spec/dummy/tmp/cache/A5C/C50/%2Fconfigurations%2Fa_config
145
+ - spec/dummy/tmp/cache/C1D/B20/%2Fconfigurations%2Fother_config
146
+ - spec/dummy/tmp/cache/DC7/960/%2Fconfigurations%2Fnot_found_config
84
147
  - spec/models/catarse_monkeymail/project_spec.rb
85
148
  - spec/models/catarse_monkeymail/user_spec.rb
86
149
  - spec/spec_helper.rb
150
+ - spec/support/project.rb
151
+ - spec/support/user.rb
87
152
  homepage: http://catarse.me
88
153
  licenses: []
89
154
  metadata: {}
@@ -103,11 +168,50 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
168
  version: '0'
104
169
  requirements: []
105
170
  rubyforge_project:
106
- rubygems_version: 2.2.2
171
+ rubygems_version: 2.2.0
107
172
  signing_key:
108
173
  specification_version: 4
109
174
  summary: Integration with the best newsletter services <3
110
175
  test_files:
176
+ - spec/controller/catarse_monkeymail/controller_concerns_spec.rb
177
+ - spec/dummy/README.rdoc
178
+ - spec/dummy/Rakefile
179
+ - spec/dummy/app/assets/javascripts/application.js
180
+ - spec/dummy/app/assets/stylesheets/application.css
181
+ - spec/dummy/app/controllers/application_controller.rb
182
+ - spec/dummy/app/helpers/application_helper.rb
183
+ - spec/dummy/app/mailers/.gitkeep
184
+ - spec/dummy/app/models/.gitkeep
185
+ - spec/dummy/app/views/layouts/application.html.erb
186
+ - spec/dummy/config.ru
187
+ - spec/dummy/config/application.rb
188
+ - spec/dummy/config/boot.rb
189
+ - spec/dummy/config/database.yml
190
+ - spec/dummy/config/environment.rb
191
+ - spec/dummy/config/environments/development.rb
192
+ - spec/dummy/config/environments/production.rb
193
+ - spec/dummy/config/environments/test.rb
194
+ - spec/dummy/config/initializers/backtrace_silencers.rb
195
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
196
+ - spec/dummy/config/initializers/inflections.rb
197
+ - spec/dummy/config/initializers/mime_types.rb
198
+ - spec/dummy/config/initializers/secret_token.rb
199
+ - spec/dummy/config/initializers/session_store.rb
200
+ - spec/dummy/config/initializers/wrap_parameters.rb
201
+ - spec/dummy/config/locales/en.yml
202
+ - spec/dummy/config/routes.rb
203
+ - spec/dummy/lib/assets/.gitkeep
204
+ - spec/dummy/log/.gitkeep
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/script/rails
210
+ - spec/dummy/tmp/cache/A5C/C50/%2Fconfigurations%2Fa_config
211
+ - spec/dummy/tmp/cache/C1D/B20/%2Fconfigurations%2Fother_config
212
+ - spec/dummy/tmp/cache/DC7/960/%2Fconfigurations%2Fnot_found_config
111
213
  - spec/models/catarse_monkeymail/project_spec.rb
112
214
  - spec/models/catarse_monkeymail/user_spec.rb
113
215
  - spec/spec_helper.rb
216
+ - spec/support/project.rb
217
+ - spec/support/user.rb
@@ -1,4 +0,0 @@
1
- module CatarseMonkeymail
2
- class ApplicationController < ActionController::Base
3
- end
4
- end
data/bin/rails DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
-
4
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
- ENGINE_PATH = File.expand_path('../../lib/catarse_monkeymail/engine', __FILE__)
6
-
7
- # Set up gems listed in the Gemfile.
8
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
9
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
10
-
11
- require 'rails/all'
12
- require 'rails/engine/commands'