message_train 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +20 -0
  3. data/.ruby-gemset +1 -1
  4. data/.scss-lint.yml +7 -0
  5. data/.simplecov +1 -1
  6. data/.travis.yml +1 -1
  7. data/Gemfile +6 -2
  8. data/LICENSE.txt +2 -2
  9. data/README.rdoc +5 -5
  10. data/Rakefile +22 -21
  11. data/VERSION +1 -1
  12. data/app/assets/javascripts/message_train.js +1 -1
  13. data/app/assets/stylesheets/message_train.scss +29 -19
  14. data/app/controllers/concerns/message_train_support.rb +41 -37
  15. data/app/controllers/message_train/application_controller.rb +1 -0
  16. data/app/controllers/message_train/boxes_controller.rb +5 -4
  17. data/app/controllers/message_train/conversations_controller.rb +8 -7
  18. data/app/controllers/message_train/messages_controller.rb +25 -22
  19. data/app/controllers/message_train/participants_controller.rb +27 -23
  20. data/app/controllers/message_train/unsubscribes_controller.rb +37 -23
  21. data/app/helpers/message_train/application_helper.rb +6 -8
  22. data/app/helpers/message_train/attachments_helper.rb +12 -4
  23. data/app/helpers/message_train/boxes_helper.rb +38 -11
  24. data/app/helpers/message_train/collectives_helper.rb +38 -12
  25. data/app/helpers/message_train/conversations_helper.rb +43 -35
  26. data/app/helpers/message_train/messages_helper.rb +32 -25
  27. data/app/mailers/message_train/application_mailer.rb +7 -4
  28. data/app/mailers/message_train/previews/receipt_mailer_preview.rb +2 -3
  29. data/app/mailers/message_train/receipt_mailer.rb +14 -4
  30. data/app/models/message_train/attachment.rb +41 -25
  31. data/app/models/message_train/box.rb +159 -122
  32. data/app/models/message_train/conversation.rb +84 -41
  33. data/app/models/message_train/ignore.rb +8 -2
  34. data/app/models/message_train/message.rb +72 -42
  35. data/app/models/message_train/receipt.rb +30 -17
  36. data/app/models/message_train/unsubscribe.rb +1 -0
  37. data/app/views/application/404.html.haml +1 -1
  38. data/app/views/layouts/mailer.html.haml +2 -2
  39. data/app/views/layouts/mailer.text.haml +1 -1
  40. data/app/views/message_train/application/_attachment_fields.html.haml +1 -1
  41. data/app/views/message_train/application/_widget.html.haml +1 -1
  42. data/app/views/message_train/application/results.json.jbuilder +1 -1
  43. data/app/views/message_train/boxes/_dropdown_list.html.haml +1 -1
  44. data/app/views/message_train/boxes/_list_item.html.haml +1 -1
  45. data/app/views/message_train/boxes/show.html.haml +1 -1
  46. data/app/views/message_train/collectives/_dropdown_list.html.haml +1 -1
  47. data/app/views/message_train/collectives/_list_item.html.haml +1 -1
  48. data/app/views/message_train/conversations/_deleted_toggle.html.haml +1 -1
  49. data/app/views/message_train/conversations/_ignored_toggle.html.haml +2 -2
  50. data/app/views/message_train/conversations/_read_toggle.html.haml +1 -1
  51. data/app/views/message_train/conversations/_toggle.html.haml +1 -1
  52. data/app/views/message_train/conversations/_trashed_toggle.html.haml +1 -1
  53. data/app/views/message_train/conversations/show.html.haml +2 -2
  54. data/app/views/message_train/conversations/show.json.jbuilder +5 -1
  55. data/app/views/message_train/messages/_form.html.haml +1 -1
  56. data/app/views/message_train/messages/_message.html.haml +6 -6
  57. data/app/views/message_train/messages/_toggle.html.haml +1 -1
  58. data/app/views/message_train/messages/show.json.jbuilder +5 -1
  59. data/app/views/message_train/participants/_participant.json.jbuilder +1 -1
  60. data/app/views/message_train/participants/index.json.jbuilder +1 -1
  61. data/app/views/message_train/participants/show.json.jbuilder +1 -1
  62. data/app/views/message_train/receipt_mailer/notification_email.html.haml +1 -1
  63. data/app/views/message_train/receipt_mailer/notification_email.text.haml +1 -1
  64. data/app/views/message_train/unsubscribes/index.html.haml +1 -1
  65. data/config/environment.rb +1 -1
  66. data/config/initializers/date_time.rb +2 -2
  67. data/config/locales/en.yml +1 -1
  68. data/config/routes.rb +37 -15
  69. data/lib/generators/message_train/install/install_generator.rb +26 -11
  70. data/lib/generators/message_train/install/templates/initializer.rb +0 -2
  71. data/lib/generators/message_train/utils.rb +11 -4
  72. data/lib/message_train/configuration.rb +4 -5
  73. data/lib/message_train/engine.rb +1 -7
  74. data/lib/message_train/localization.rb +14 -18
  75. data/lib/message_train/mixin.rb +211 -150
  76. data/lib/message_train/version.rb +1 -0
  77. data/lib/message_train.rb +7 -6
  78. data/message_train.gemspec +24 -11
  79. data/spec/controllers/message_train/boxes_controller_spec.rb +63 -15
  80. data/spec/controllers/message_train/concerns_spec.rb +17 -13
  81. data/spec/controllers/message_train/conversations_controller_spec.rb +44 -12
  82. data/spec/controllers/message_train/messages_controller_spec.rb +87 -40
  83. data/spec/controllers/message_train/participants_controller_spec.rb +10 -4
  84. data/spec/controllers/message_train/unsubscribes_controller_spec.rb +43 -13
  85. data/spec/dummy/Rakefile +2 -1
  86. data/spec/dummy/app/assets/stylesheets/application.css.scss +7 -23
  87. data/spec/dummy/app/controllers/application_controller.rb +7 -7
  88. data/spec/dummy/app/models/group.rb +1 -1
  89. data/spec/dummy/app/models/role.rb +11 -7
  90. data/spec/dummy/app/models/user.rb +6 -5
  91. data/spec/dummy/app/views/layouts/_top_navigation.html.haml +1 -1
  92. data/spec/dummy/app/views/layouts/application.html.haml +1 -1
  93. data/spec/dummy/app/views/pages/index.html.haml +1 -1
  94. data/spec/dummy/config/application.rb +23 -17
  95. data/spec/dummy/config/environments/development.rb +5 -4
  96. data/spec/dummy/config/environments/production.rb +10 -6
  97. data/spec/dummy/config/environments/test.rb +4 -3
  98. data/spec/dummy/config/initializers/assets.rb +2 -1
  99. data/spec/dummy/config/initializers/backtrace_silencers.rb +4 -2
  100. data/spec/dummy/config/initializers/bootstrap_leather.rb +1 -1
  101. data/spec/dummy/config/initializers/devise.rb +63 -44
  102. data/spec/dummy/config/initializers/high_voltage.rb +1 -1
  103. data/spec/dummy/config/initializers/message_train.rb +5 -2
  104. data/spec/dummy/config/initializers/mime_types.rb +1 -1
  105. data/spec/dummy/config/initializers/paperclip.rb +5 -2
  106. data/spec/dummy/config/initializers/rolify.rb +3 -2
  107. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -1
  108. data/spec/dummy/config/routes.rb +1 -3
  109. data/spec/dummy/config/settings.yml +1 -1
  110. data/spec/dummy/db/schema.rb +98 -98
  111. data/spec/dummy/db/seeds/conversations.seeds.rb +160 -160
  112. data/spec/dummy/db/seeds/development/conversations.seeds.rb +6 -2
  113. data/spec/dummy/db/seeds/groups.seeds.rb +11 -12
  114. data/spec/dummy/db/seeds/test/attachments.seeds.rb +13 -3
  115. data/spec/dummy/db/seeds/test/conversations.seeds.rb +6 -2
  116. data/spec/dummy/db/seeds/unsubscribes.seeds.rb +1 -1
  117. data/spec/dummy/db/seeds/users.seeds.rb +47 -42
  118. data/spec/dummy/db/test.sqlite3 +0 -0
  119. data/spec/factories/attachment.rb +6 -2
  120. data/spec/factories/group.rb +1 -4
  121. data/spec/factories/message.rb +29 -23
  122. data/spec/factories/user.rb +6 -4
  123. data/spec/features/boxes_spec.rb +76 -24
  124. data/spec/features/conversations_spec.rb +19 -7
  125. data/spec/features/messages_spec.rb +24 -5
  126. data/spec/features/unsubscribes_spec.rb +36 -9
  127. data/spec/helpers/message_train/application_helper_spec.rb +1 -1
  128. data/spec/helpers/message_train/attachment_helper_spec.rb +27 -12
  129. data/spec/helpers/message_train/boxes_helper_spec.rb +1 -1
  130. data/spec/helpers/message_train/collectives_helper_spec.rb +25 -9
  131. data/spec/helpers/message_train/conversations_helper_spec.rb +239 -120
  132. data/spec/helpers/message_train/messages_helper_spec.rb +137 -81
  133. data/spec/message_train_spec.rb +3 -2
  134. data/spec/models/group_spec.rb +12 -9
  135. data/spec/models/message_train/attachment_spec.rb +33 -30
  136. data/spec/models/message_train/box_spec.rb +243 -60
  137. data/spec/models/message_train/conversation_spec.rb +16 -12
  138. data/spec/models/message_train/ignore_spec.rb +3 -1
  139. data/spec/models/message_train/message_spec.rb +22 -7
  140. data/spec/models/message_train/receipt_spec.rb +14 -4
  141. data/spec/models/role_spec.rb +10 -6
  142. data/spec/models/user_spec.rb +74 -22
  143. data/spec/rails_helper.rb +9 -4
  144. data/spec/spec_helper.rb +6 -54
  145. data/spec/support/controller_behaviors.rb +8 -5
  146. data/spec/support/controller_macros.rb +2 -2
  147. data/spec/support/factory_girl.rb +1 -1
  148. data/spec/support/feature_behaviors.rb +42 -13
  149. data/spec/support/loaded_site/attachments.rb +8 -0
  150. data/spec/support/loaded_site/conversations.rb +73 -0
  151. data/spec/support/{groups.rb → loaded_site/groups.rb} +1 -1
  152. data/spec/support/{loaded_site.rb → loaded_site/loaded_site.rb} +1 -1
  153. data/spec/support/{messages.rb → loaded_site/messages.rb} +13 -5
  154. data/spec/support/{roles.rb → loaded_site/roles.rb} +1 -1
  155. data/spec/support/{users.rb → loaded_site/users.rb} +1 -1
  156. data/spec/support/shared_connection.rb +8 -6
  157. data/spec/support/utilities.rb +10 -10
  158. metadata +67 -10
  159. data/spec/dummy/config/unused/temporary_i18n_debugging.rb +0 -12
  160. data/spec/support/attachments.rb +0 -4
  161. data/spec/support/conversations.rb +0 -23
@@ -0,0 +1,73 @@
1
+ shared_context 'conversations' do
2
+ let(:sent_conversation) do
3
+ MessageTrain::Conversation.find_by_subject('Sent Conversation')
4
+ end
5
+ let(:unread_conversation) do
6
+ MessageTrain::Conversation.find_by_subject('Unread Conversation')
7
+ end
8
+ let(:to_many_conversation) do
9
+ MessageTrain::Conversation.find_by_subject('To Many Conversation')
10
+ end
11
+ let(:ignored_conversation) do
12
+ MessageTrain::Conversation.find_by_subject('Ignored Conversation')
13
+ end
14
+ let(:trashed_conversation) do
15
+ MessageTrain::Conversation.find_by_subject('Trashed Conversation')
16
+ end
17
+ let(:read_conversation) do
18
+ MessageTrain::Conversation.find_by_subject('Read Conversation')
19
+ end
20
+ let(:attachment_conversation) do
21
+ MessageTrain::Conversation.find_by_subject('Attachment Conversation')
22
+ end
23
+ let(:deleted_conversation) do
24
+ MessageTrain::Conversation.find_by_subject('Deleted Conversation')
25
+ end
26
+ let(:group_conversation) do
27
+ MessageTrain::Conversation.find_by_subject('Group Announcement')
28
+ end
29
+ let(:membered_group_conversation) do
30
+ MessageTrain::Conversation.find_by_subject('Membered Group Announcement')
31
+ end
32
+ let(:membered_group_trashed_conversation) do
33
+ MessageTrain::Conversation.find_by_subject(
34
+ 'Membered Group Trashed Conversation'
35
+ )
36
+ end
37
+ let(:membered_group_read_conversation) do
38
+ MessageTrain::Conversation.find_by_subject(
39
+ 'Membered Group Read Conversation'
40
+ )
41
+ end
42
+ let(:membered_group_ignored_conversation) do
43
+ MessageTrain::Conversation.find_by_subject(
44
+ 'Membered Group Ignored Conversation'
45
+ )
46
+ end
47
+ let(:membered_group_deleted_conversation) do
48
+ MessageTrain::Conversation.find_by_subject(
49
+ 'Membered Group Deleted Conversation'
50
+ )
51
+ end
52
+ let(:membered_group_draft) do
53
+ MessageTrain::Conversation.find_by_subject('Membered Group Draft')
54
+ end
55
+ let(:owned_group_draft) do
56
+ MessageTrain::Conversation.find_by_subject('Owned Group Draft')
57
+ end
58
+ let(:someone_elses_conversation) do
59
+ MessageTrain::Conversation.find_by_subject("Someone Else's Conversation")
60
+ end
61
+ let(:draft_conversation) do
62
+ MessageTrain::Conversation.find_by_subject('This should turn into a draft')
63
+ end
64
+ let(:long_conversation) do
65
+ MessageTrain::Conversation.find_by_subject('Long Conversation')
66
+ end
67
+ let(:role_conversation) do
68
+ MessageTrain::Conversation.find_by_subject('Role Conversation')
69
+ end
70
+ let(:role_draft) do
71
+ MessageTrain::Conversation.find_by_subject('Role Draft')
72
+ end
73
+ end
@@ -3,4 +3,4 @@ shared_context 'groups' do
3
3
  let(:membered_group) { Group.find_by_title('Membered Group') }
4
4
  let(:empty_group) { Group.find_by_title('Empty Group') }
5
5
  let(:unsubscribed_group) { Group.find_by_title('Unsubscribed Group') }
6
- end
6
+ end
@@ -5,4 +5,4 @@ shared_context 'loaded site' do
5
5
  include_context 'conversations'
6
6
  include_context 'messages'
7
7
  include_context 'attachments'
8
- end
8
+ end
@@ -9,10 +9,18 @@ shared_context 'messages' do
9
9
  let(:deleted_message) { deleted_conversation.messages.first }
10
10
  let(:group_message) { group_conversation.messages.first }
11
11
  let(:membered_group_message) { membered_group_conversation.messages.first }
12
- let(:membered_group_trashed_message) { membered_group_trashed_conversation.messages.first }
13
- let(:membered_group_read_message) { membered_group_read_conversation.messages.first }
14
- let(:membered_group_ignored_message) { membered_group_ignored_conversation.messages.first }
15
- let(:membered_group_deleted_message) { membered_group_deleted_conversation.messages.first }
12
+ let(:membered_group_trashed_message) do
13
+ membered_group_trashed_conversation.messages.first
14
+ end
15
+ let(:membered_group_read_message) do
16
+ membered_group_read_conversation.messages.first
17
+ end
18
+ let(:membered_group_ignored_message) do
19
+ membered_group_ignored_conversation.messages.first
20
+ end
21
+ let(:membered_group_deleted_message) do
22
+ membered_group_deleted_conversation.messages.first
23
+ end
16
24
  let(:membered_group_draft_message) { membered_group_draft.messages.first }
17
25
  let(:owned_group_draft_message) { owned_group_draft.messages.first }
18
26
  let(:someone_elses_message) { someone_elses_conversation.messages.first }
@@ -20,4 +28,4 @@ shared_context 'messages' do
20
28
  let(:long_message) { long_conversation.messages.first }
21
29
  let(:role_message) { role_conversation.messages.first }
22
30
  let(:role_draft_message) { role_draft.messages.first }
23
- end
31
+ end
@@ -1,4 +1,4 @@
1
1
  shared_context 'roles' do
2
2
  let(:superadmin_role) { Role.find_by_name('superadmin') }
3
3
  let(:admin_role) { Role.find_by_name('admin') }
4
- end
4
+ end
@@ -9,4 +9,4 @@ shared_context 'users' do
9
9
  let(:silent_user) { User.friendly.find('silent-user') }
10
10
  let(:unsubscribed_user) { User.friendly.find('unsubscribed-user') }
11
11
  let(:last_user) { User.order('id').last }
12
- end
12
+ end
@@ -1,12 +1,14 @@
1
- class ActiveRecord::Base
2
- mattr_accessor :shared_connection
3
- @@shared_connection = nil
1
+ module ActiveRecord
2
+ class Base
3
+ mattr_accessor :shared_connection
4
+ @@shared_connection = nil
4
5
 
5
- def self.connection
6
- @@shared_connection || retrieve_connection
6
+ def self.connection
7
+ @@shared_connection || retrieve_connection
8
+ end
7
9
  end
8
10
  end
9
11
 
10
12
  # Forces all threads to share the same connection. This works on
11
13
  # Capybara because it starts the web server in a thread.
12
- ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
14
+ ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
@@ -1,10 +1,11 @@
1
1
  def path_to_url(path)
2
- "#{request.protocol}#{request.host_with_port.sub(/:80$/,"")}/#{path.sub(/^\//,"")}"
2
+ "#{request.protocol}#{request.host_with_port.sub(/:80$/, '')}/"\
3
+ "#{path.sub(%r{^/}, '')}"
3
4
  end
4
5
 
5
6
  def show_page
6
- save_page Rails.root.join( 'public', 'capybara.html' )
7
- %x(launchy http://localhost:3000/capybara.html)
7
+ save_page Rails.root.join('public', 'capybara.html')
8
+ `launchy http://localhost:3000/capybara.html`
8
9
  end
9
10
 
10
11
  def submit_via_button(button_name)
@@ -29,12 +30,11 @@ def fill_in_autocomplete(field, options = {})
29
30
  field = find_field_by_label(field)
30
31
  fill_in field, with: options[:with]
31
32
 
32
- page.execute_script %Q{ $('##{field}').trigger('focus') }
33
- page.execute_script %Q{ $('##{field}').trigger('keydown') }
34
- selector = %Q{.tt-menu .tt-suggestion:contains("#{options[:with]}")}
35
-
33
+ page.execute_script "$('##{field}').trigger('focus')"
34
+ page.execute_script "$('##{field}').trigger('keydown')"
36
35
  if page.has_selector?('.tt-menu .tt-suggestion')
37
- page.execute_script %Q{ $('#{selector}').trigger('mouseenter').click() }
36
+ selector = ".tt-menu .tt-suggestion:contains('#{options[:with]}')"
37
+ page.execute_script '$("' + selector + '").trigger("mouseenter").click()'
38
38
  end
39
39
  end
40
40
 
@@ -54,6 +54,6 @@ def wait_until(delay = 1)
54
54
  end
55
55
  unless yield
56
56
  puts "Waited for #{Capybara.default_max_wait_time} seconds."
57
- puts "{#{yield}} did not become true, continuing."
57
+ puts "{ #{yield} } did not become true, continuing."
58
58
  end
59
- end
59
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -304,6 +304,62 @@ dependencies:
304
304
  - - "~>"
305
305
  - !ruby/object:Gem::Version
306
306
  version: '2.0'
307
+ - !ruby/object:Gem::Dependency
308
+ name: pre-commit
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - "~>"
312
+ - !ruby/object:Gem::Version
313
+ version: '0.27'
314
+ type: :development
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - "~>"
319
+ - !ruby/object:Gem::Version
320
+ version: '0.27'
321
+ - !ruby/object:Gem::Dependency
322
+ name: rubocop
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - "~>"
326
+ - !ruby/object:Gem::Version
327
+ version: '0.37'
328
+ type: :development
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - "~>"
333
+ - !ruby/object:Gem::Version
334
+ version: '0.37'
335
+ - !ruby/object:Gem::Dependency
336
+ name: coffeelint
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - "~>"
340
+ - !ruby/object:Gem::Version
341
+ version: '1.14'
342
+ type: :development
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - "~>"
347
+ - !ruby/object:Gem::Version
348
+ version: '1.14'
349
+ - !ruby/object:Gem::Dependency
350
+ name: scss_lint
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - "~>"
354
+ - !ruby/object:Gem::Version
355
+ version: 0.47.0
356
+ type: :development
357
+ prerelease: false
358
+ version_requirements: !ruby/object:Gem::Requirement
359
+ requirements:
360
+ - - "~>"
361
+ - !ruby/object:Gem::Version
362
+ version: 0.47.0
307
363
  - !ruby/object:Gem::Dependency
308
364
  name: sqlite3
309
365
  requirement: !ruby/object:Gem::Requirement
@@ -469,8 +525,10 @@ extra_rdoc_files:
469
525
  files:
470
526
  - ".document"
471
527
  - ".rspec"
528
+ - ".rubocop.yml"
472
529
  - ".ruby-gemset"
473
530
  - ".ruby-version"
531
+ - ".scss-lint.yml"
474
532
  - ".simplecov"
475
533
  - ".travis.yml"
476
534
  - Gemfile
@@ -650,7 +708,6 @@ files:
650
708
  - spec/dummy/config/routes.rb
651
709
  - spec/dummy/config/secrets.yml
652
710
  - spec/dummy/config/settings.yml
653
- - spec/dummy/config/unused/temporary_i18n_debugging.rb
654
711
  - spec/dummy/db/migrate/20150721140013_devise_create_users.rb
655
712
  - spec/dummy/db/migrate/20150721141009_rolify_create_roles.rb
656
713
  - spec/dummy/db/migrate/20150721141128_create_groups.rb
@@ -706,18 +763,18 @@ files:
706
763
  - spec/models/user_spec.rb
707
764
  - spec/rails_helper.rb
708
765
  - spec/spec_helper.rb
709
- - spec/support/attachments.rb
710
766
  - spec/support/controller_behaviors.rb
711
767
  - spec/support/controller_macros.rb
712
- - spec/support/conversations.rb
713
768
  - spec/support/factory_girl.rb
714
769
  - spec/support/feature_behaviors.rb
715
- - spec/support/groups.rb
716
- - spec/support/loaded_site.rb
717
- - spec/support/messages.rb
718
- - spec/support/roles.rb
770
+ - spec/support/loaded_site/attachments.rb
771
+ - spec/support/loaded_site/conversations.rb
772
+ - spec/support/loaded_site/groups.rb
773
+ - spec/support/loaded_site/loaded_site.rb
774
+ - spec/support/loaded_site/messages.rb
775
+ - spec/support/loaded_site/roles.rb
776
+ - spec/support/loaded_site/users.rb
719
777
  - spec/support/shared_connection.rb
720
- - spec/support/users.rb
721
778
  - spec/support/utilities.rb
722
779
  homepage: http://www.gemvein.com/museum/cases/message_train
723
780
  licenses:
@@ -1,12 +0,0 @@
1
- module I18n
2
- module Registry
3
- protected
4
- def lookup(locale, key, scope = [], options = {})
5
- @log ||= Logger.new(File.join(Rails.root, 'log', 'i18n_registry.log'))
6
- @log.info key
7
- super
8
- end
9
- end
10
- end
11
-
12
- I18n::Backend::Simple.send :include, I18n::Registry
@@ -1,4 +0,0 @@
1
- shared_context 'attachments' do
2
- let(:image_attachment) { MessageTrain::Attachment.find_by("attachment_file_name LIKE '%image-sample.jpg'") }
3
- let(:pdf_attachment) { MessageTrain::Attachment.find_by("attachment_file_name LIKE '%pdf-sample.pdf'") }
4
- end
@@ -1,23 +0,0 @@
1
- shared_context 'conversations' do
2
- let(:sent_conversation) { MessageTrain::Conversation.find_by_subject('Sent Conversation') }
3
- let(:unread_conversation) { MessageTrain::Conversation.find_by_subject('Unread Conversation') }
4
- let(:to_many_conversation) { MessageTrain::Conversation.find_by_subject('To Many Conversation') }
5
- let(:ignored_conversation) { MessageTrain::Conversation.find_by_subject('Ignored Conversation') }
6
- let(:trashed_conversation) { MessageTrain::Conversation.find_by_subject('Trashed Conversation') }
7
- let(:read_conversation) { MessageTrain::Conversation.find_by_subject('Read Conversation') }
8
- let(:attachment_conversation) { MessageTrain::Conversation.find_by_subject('Attachment Conversation') }
9
- let(:deleted_conversation) { MessageTrain::Conversation.find_by_subject('Deleted Conversation') }
10
- let(:group_conversation) { MessageTrain::Conversation.find_by_subject('Group Announcement') }
11
- let(:membered_group_conversation) { MessageTrain::Conversation.find_by_subject('Membered Group Announcement') }
12
- let(:membered_group_trashed_conversation) { MessageTrain::Conversation.find_by_subject('Membered Group Trashed Conversation') }
13
- let(:membered_group_read_conversation) { MessageTrain::Conversation.find_by_subject('Membered Group Read Conversation') }
14
- let(:membered_group_ignored_conversation) { MessageTrain::Conversation.find_by_subject('Membered Group Ignored Conversation') }
15
- let(:membered_group_deleted_conversation) { MessageTrain::Conversation.find_by_subject('Membered Group Deleted Conversation') }
16
- let(:membered_group_draft) { MessageTrain::Conversation.find_by_subject('Membered Group Draft') }
17
- let(:owned_group_draft) { MessageTrain::Conversation.find_by_subject('Owned Group Draft') }
18
- let(:someone_elses_conversation) { MessageTrain::Conversation.find_by_subject("Someone Else's Conversation") }
19
- let(:draft_conversation) { MessageTrain::Conversation.find_by_subject('This should turn into a draft')}
20
- let(:long_conversation) { MessageTrain::Conversation.find_by_subject('Long Conversation')}
21
- let(:role_conversation) { MessageTrain::Conversation.find_by_subject('Role Conversation')}
22
- let(:role_draft) { MessageTrain::Conversation.find_by_subject('Role Draft')}
23
- end