message_train 0.3.0 → 0.3.1

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: 7bb7f77562529d2b1188b842eb4ed71774d54061
4
- data.tar.gz: abd3169166b791465703f7afc039fb9d50cc44c8
3
+ metadata.gz: 712bc245d27104152fc3be51a4d599273f839b44
4
+ data.tar.gz: 6decf2e25a128e08535900656121aece93e6f02f
5
5
  SHA512:
6
- metadata.gz: e2ac933194e6cac58dab162a980ab8d5789833d9503a3e3a5b9664ff63bf2e3a68d9a726061ee334a9043f5bd73c49916c2ed5000b7280587f502c1eaeb6b4f7
7
- data.tar.gz: a94b66e5f57065064bc06bc34cb0e108b8f8e49629d84091516166d50b59c77a4c075a11757d852adf3edc3c150b1670e404be2569e7c446f048b08a80e3729c
6
+ metadata.gz: 9853cb01edcc15fe18103c15a66f4f008868a7e9143b395c6d41b1967b35950da5370a2b47783bee75e76b4ea3e3af41a84bb973f22212dd61e7928ed3ccfb5a
7
+ data.tar.gz: c140454a9b30a82c4c37cf2a235b5110dac49aafe55f03e8a9159f243225b9a9311f99e9956683cb1001e5229c436734fecd815f641aa55aa63a2ba5a2355260
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/config/routes.rb CHANGED
@@ -14,7 +14,18 @@ MessageTrain::Engine.routes.draw do
14
14
  resources :unsubscribes, only: [:index, :create, :destroy]
15
15
  end
16
16
 
17
- match '/box(/*path)', to: redirect(MessageTrain.configuration.user_sign_in_path), via: [:get, :put, :post, :delete]
18
- match '/collectives(/*path)', to: redirect(MessageTrain.configuration.user_sign_in_path), via: [:get, :put, :post, :delete]
19
- match '/unsubscribes(/*path)', to: redirect(MessageTrain.configuration.user_sign_in_path), via: [:get, :put, :post, :delete]
17
+ match '/box(/*path)' => redirect { |p, req|
18
+ req.flash[:error] = :you_must_sign_in_or_sign_up_to_continue.l
19
+ MessageTrain.configuration.user_sign_in_path
20
+ }, via: [:get, :put, :post, :delete]
21
+
22
+ match '/collectives(/*path)' => redirect { |p, req|
23
+ req.flash[:error] = :you_must_sign_in_or_sign_up_to_continue.l
24
+ MessageTrain.configuration.user_sign_in_path
25
+ }, via: [:get, :put, :post, :delete]
26
+
27
+ match '/unsubscribes(/*path)' => redirect { |p, req|
28
+ req.flash[:error] = :you_must_sign_in_or_sign_up_to_continue.l
29
+ MessageTrain.configuration.user_sign_in_path
30
+ }, via: [:get, :put, :post, :delete]
20
31
  end
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: message_train 0.3.0 ruby lib
5
+ # stub: message_train 0.3.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "message_train"
9
- s.version = "0.3.0"
9
+ s.version = "0.3.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -6,12 +6,13 @@ describe MessageTrain::BoxesController do
6
6
  routes { MessageTrain::Engine.routes }
7
7
 
8
8
  describe "GET #show" do
9
- describe 'when not logged in' do
10
- before do
11
- get :show, division: 'in'
12
- end
13
- it_should_behave_like 'a redirect with notice', '/users/sign_in', 'You must sign in or sign up to continue.'
14
- end
9
+ # describe 'when not logged in' do
10
+ # before do
11
+ # access_anonymous
12
+ # get :show, division: 'in'
13
+ # end
14
+ # it_should_behave_like 'a redirect with error', '/users/sign_in', 'You must sign in or sign up to continue.'
15
+ # end
15
16
 
16
17
  describe 'when neither sending nor receiving is allowed' do
17
18
  before do
Binary file
@@ -2,6 +2,9 @@ require 'rails_helper'
2
2
  RSpec.feature 'Boxes' do
3
3
  include_context 'loaded site'
4
4
 
5
+ it_behaves_like 'an authenticated section', '/box'
6
+ it_behaves_like 'an authenticated section', '/collectives/groups:membered-group'
7
+
5
8
  describe 'When logged in as first-user' do
6
9
  before do
7
10
  login_as first_user
@@ -2,41 +2,45 @@ require 'rails_helper'
2
2
  RSpec.feature 'Conversations' do
3
3
  include_context 'loaded site'
4
4
 
5
- before do
6
- login_as first_user
7
- end
8
- describe 'Showing' do
9
- describe 'at /box/in/conversations/:id' do
10
- before do
11
- visit '/box/in/conversations/' + unread_conversation.id.to_s
12
- end
13
- it_behaves_like 'a bootstrap page showing an item', MessageTrain::Conversation, 'Unread Conversation'
5
+ it_behaves_like 'an authenticated section', '/box/in/conversations/1'
14
6
 
15
- describe 'shows a reply link' do
16
- before do
17
- click_link 'Reply'
18
- end
19
- it_behaves_like 'a bootstrap page', title: 'Reply'
20
- end
7
+ describe 'When logged in' do
8
+ before do
9
+ login_as first_user
21
10
  end
22
- end
23
- describe 'Marking', js: true do
24
- describe 'at /box/in/conversations/:id' do
25
- describe 'Marking Read' do
11
+ describe 'Showing' do
12
+ describe 'at /box/in/conversations/:id' do
26
13
  before do
27
14
  visit '/box/in/conversations/' + unread_conversation.id.to_s
28
- click_link "mark_read_#{unread_message.id.to_s}"
29
15
  end
30
- it_behaves_like 'a bootstrap page with an alert', 'info', 'Update successful'
16
+ it_behaves_like 'a bootstrap page showing an item', MessageTrain::Conversation, 'Unread Conversation'
17
+
18
+ describe 'shows a reply link' do
19
+ before do
20
+ click_link 'Reply'
21
+ end
22
+ it_behaves_like 'a bootstrap page', title: 'Reply'
23
+ end
31
24
  end
32
- describe 'Marking Ignored' do
33
- before do
34
- visit '/box/in/conversations/' + unread_conversation.id.to_s
35
- accept_confirm do
36
- click_link 'Mark as Ignored'
25
+ end
26
+ describe 'Marking', js: true do
27
+ describe 'at /box/in/conversations/:id' do
28
+ describe 'Marking Read' do
29
+ before do
30
+ visit '/box/in/conversations/' + unread_conversation.id.to_s
31
+ click_link "mark_read_#{unread_message.id.to_s}"
32
+ end
33
+ it_behaves_like 'a bootstrap page with an alert', 'info', 'Update successful'
34
+ end
35
+ describe 'Marking Ignored' do
36
+ before do
37
+ visit '/box/in/conversations/' + unread_conversation.id.to_s
38
+ accept_confirm do
39
+ click_link 'Mark as Ignored'
40
+ end
37
41
  end
42
+ it_behaves_like 'a bootstrap page with an alert', 'info', 'Update successful'
38
43
  end
39
- it_behaves_like 'a bootstrap page with an alert', 'info', 'Update successful'
40
44
  end
41
45
  end
42
46
  end
@@ -3,65 +3,69 @@ RSpec.feature 'Messages' do
3
3
  include_context 'loaded site'
4
4
  include Wysihtml5Helper
5
5
 
6
- before do
7
- login_as first_user
8
- end
9
- describe 'Drafting', js: true do
10
- describe 'at /box/in/messages' do
11
- before do
12
- visit '/box/in/messages/new/'
13
- recipient_input = find(:css, "#message_recipients_to_save_users .tags-input")
14
- recipient_input.set("")
15
- fill_in 'Subject', with: 'This is a draft.'
16
- fill_in_html 'Body', with: 'This is the body.'
17
- click_button 'Send'
18
- end
19
- it_behaves_like 'a bootstrap page with an alert', 'warning', 'Message saved as draft.'
6
+ it_behaves_like 'an authenticated section', '/box/in/messages/new'
7
+
8
+ describe 'When logged in' do
9
+ before do
10
+ login_as first_user
20
11
  end
21
- end
22
- describe 'Composing', js: true do
23
- describe 'at /box/in/messages' do
24
- before do
25
- visit '/box/in/messages/new/'
26
- recipient_input = find(:css, "#message_recipients_to_save_users .tags-input")
27
- recipient_input.set("sec") # Should auto-complete to second-user with the following two key-presses
28
- recipient_input.native.send_keys :arrow_down
29
- recipient_input.native.send_keys :return
30
- fill_in 'Subject', with: 'This is the subject.'
31
- fill_in_html 'Body', with: 'This is the body.'
32
- click_link 'add-attachment'
33
- click_link 'add-attachment'
34
- click_link 'add-attachment'
35
- within '#attachments .nested-fields:nth-child(1)' do
36
- attach_file 'Attachment', File.absolute_path('./spec/dummy/app/assets/files/message_train/attachments/example.pdf')
37
- end
38
- within '#attachments .nested-fields:nth-child(2)' do
39
- attach_file 'Attachment', File.absolute_path('./spec/dummy/app/assets/files/message_train/attachments/Bambisj.jpg')
12
+ describe 'Drafting', js: true do
13
+ describe 'at /box/in/messages' do
14
+ before do
15
+ visit '/box/in/messages/new/'
16
+ recipient_input = find(:css, "#message_recipients_to_save_users .tags-input")
17
+ recipient_input.set("")
18
+ fill_in 'Subject', with: 'This is a draft.'
19
+ fill_in_html 'Body', with: 'This is the body.'
20
+ click_button 'Send'
40
21
  end
41
- within '#attachments .nested-fields:nth-child(3)' do
42
- accept_confirm do
43
- find('.remove_fields').click
22
+ it_behaves_like 'a bootstrap page with an alert', 'warning', 'Message saved as draft.'
23
+ end
24
+ end
25
+ describe 'Composing', js: true do
26
+ describe 'at /box/in/messages' do
27
+ before do
28
+ visit '/box/in/messages/new/'
29
+ recipient_input = find(:css, "#message_recipients_to_save_users .tags-input")
30
+ recipient_input.set("sec") # Should auto-complete to second-user with the following two key-presses
31
+ recipient_input.native.send_keys :arrow_down
32
+ recipient_input.native.send_keys :return
33
+ fill_in 'Subject', with: 'This is the subject.'
34
+ fill_in_html 'Body', with: 'This is the body.'
35
+ click_link 'add-attachment'
36
+ click_link 'add-attachment'
37
+ click_link 'add-attachment'
38
+ within '#attachments .nested-fields:nth-child(1)' do
39
+ attach_file 'Attachment', File.absolute_path('./spec/dummy/app/assets/files/message_train/attachments/example.pdf')
40
+ end
41
+ within '#attachments .nested-fields:nth-child(2)' do
42
+ attach_file 'Attachment', File.absolute_path('./spec/dummy/app/assets/files/message_train/attachments/Bambisj.jpg')
43
+ end
44
+ within '#attachments .nested-fields:nth-child(3)' do
45
+ accept_confirm do
46
+ find('.remove_fields').click
47
+ end
44
48
  end
49
+ click_button 'Send'
45
50
  end
46
- click_button 'Send'
51
+ it_behaves_like 'a bootstrap page with an alert', 'info', 'Message sent.'
47
52
  end
48
- it_behaves_like 'a bootstrap page with an alert', 'info', 'Message sent.'
49
53
  end
50
- end
51
- describe 'Editing a Draft', js: true do
52
- describe 'at /box/in/messages' do
53
- before do
54
- visit "/box/in/conversations/#{draft_conversation.id}"
55
- recipient_input = find(:css, "#message_recipients_to_save_users .tags-input")
56
- recipient_input.set("sec") # Should auto-complete to second-user with the following two key-presses
57
- recipient_input.native.send_keys :arrow_down
58
- recipient_input.native.send_keys :return
59
- fill_in 'Subject', with: 'This is the subject.'
60
- fill_in_html 'Body', with: 'This is the body.'
61
- click_button 'Send'
54
+ describe 'Editing a Draft', js: true do
55
+ describe 'at /box/in/messages' do
56
+ before do
57
+ visit "/box/in/conversations/#{draft_conversation.id}"
58
+ recipient_input = find(:css, "#message_recipients_to_save_users .tags-input")
59
+ recipient_input.set("sec") # Should auto-complete to second-user with the following two key-presses
60
+ recipient_input.native.send_keys :arrow_down
61
+ recipient_input.native.send_keys :return
62
+ fill_in 'Subject', with: 'This is the subject.'
63
+ fill_in_html 'Body', with: 'This is the body.'
64
+ click_button 'Send'
65
+ end
66
+ it_behaves_like 'a bootstrap page with an alert', 'info', 'Message sent.'
67
+ it_behaves_like 'a bootstrap page without an alert', 'warning'
62
68
  end
63
- it_behaves_like 'a bootstrap page with an alert', 'info', 'Message sent.'
64
- it_behaves_like 'a bootstrap page without an alert', 'warning'
65
69
  end
66
70
  end
67
71
  end
@@ -2,37 +2,41 @@ require 'rails_helper'
2
2
  RSpec.feature 'Unsubscribes' do
3
3
  include_context 'loaded site'
4
4
 
5
- before do
6
- login_as first_user
7
- end
8
- describe 'Index' do
9
- describe 'at /unsubscribes' do
10
- before do
11
- visit '/unsubscribes'
12
- end
13
- it_behaves_like 'a bootstrap page', title: 'Manage Your Email Notifications'
14
- context "displays a list of #subscriptions in .subscription" do
15
- subject { page }
16
- it { should have_css("#subscriptions .subscription", minimum: 3) }
5
+ it_behaves_like 'an authenticated section', '/unsubscribes'
6
+
7
+ describe 'When logged in' do
8
+ before do
9
+ login_as first_user
10
+ end
11
+ describe 'Index' do
12
+ describe 'at /unsubscribes' do
13
+ before do
14
+ visit '/unsubscribes'
15
+ end
16
+ it_behaves_like 'a bootstrap page', title: 'Manage Your Email Notifications'
17
+ context "displays a list of #subscriptions in .subscription" do
18
+ subject { page }
19
+ it { should have_css("#subscriptions .subscription", minimum: 3) }
20
+ end
17
21
  end
18
22
  end
19
- end
20
- describe 'Unsubscribing' do
21
- describe 'at /unsubscribes' do
22
- before do
23
- visit '/unsubscribes'
24
- find("#unsubscribe-group-#{membered_group.id.to_s}").click
23
+ describe 'Unsubscribing' do
24
+ describe 'at /unsubscribes' do
25
+ before do
26
+ visit '/unsubscribes'
27
+ find("#unsubscribe-group-#{membered_group.id.to_s}").click
28
+ end
29
+ it_behaves_like 'a bootstrap page with an alert', 'info', 'You are now unsubscribed from Membered Group, which means that you will not be notified by email of any messages received by that Group.'
25
30
  end
26
- it_behaves_like 'a bootstrap page with an alert', 'info', 'You are now unsubscribed from Membered Group, which means that you will not be notified by email of any messages received by that Group.'
27
31
  end
28
- end
29
- describe 'Removing an Unsubscribe' do
30
- describe 'at /unsubscribes' do
31
- before do
32
- visit '/unsubscribes'
33
- find("#remove-unsubscribe-#{unsubscribed_group.id.to_s}").click
32
+ describe 'Removing an Unsubscribe' do
33
+ describe 'at /unsubscribes' do
34
+ before do
35
+ visit '/unsubscribes'
36
+ find("#remove-unsubscribe-#{unsubscribed_group.id.to_s}").click
37
+ end
38
+ it_behaves_like 'a bootstrap page with an alert', 'info', 'You are no longer unsubscribed from Unsubscribed Group, which means that you will now be notified by email of any messages received in that Group.'
34
39
  end
35
- it_behaves_like 'a bootstrap page with an alert', 'info', 'You are no longer unsubscribed from Unsubscribed Group, which means that you will now be notified by email of any messages received in that Group.'
36
40
  end
37
41
  end
38
42
  end
@@ -1,3 +1,17 @@
1
+ shared_examples_for 'an authenticated section' do |path|
2
+ describe 'requires login' do
3
+ before do
4
+ visit path
5
+ end
6
+ it_behaves_like 'a bootstrap page with an alert', 'danger', 'You must sign in or sign up to continue.'
7
+ context 'displays a login form' do
8
+ subject { page }
9
+ it { should have_selector 'form.new_user input#user_email' }
10
+ it { should have_selector 'form.new_user input#user_password' }
11
+ end
12
+ end
13
+ end
14
+
1
15
  shared_examples_for 'a bootstrap page' do |options = {}|
2
16
  include ERB::Util
3
17
  context 'displays a page with bootstrap elements' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren