contact_us 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/contact_us/version.rb +1 -1
- data/spec/features/contact_us_lint_spec.rb +26 -26
- data/spec/spec_helper.rb +1 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ec0fa58f0c1f02fd8057e114737f22559cf3e37
|
4
|
+
data.tar.gz: e057a8b3e3f293790212e9cad6c3532a4bf4cec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8fdf4da521c0d2df8b0077b2fad010ff1df55e64d1abec819c8babdc497d335c85399d7dd2468eead7cacf423991062e99b4121a7b24a7512817eee20e90cd1
|
7
|
+
data.tar.gz: 7c20170c0a29cce28e0046a4e7d4bcc9036ecfff4641895d7c955cbfeb4da2b193243525f3717b44a12479a0126ccd6150842dc004e26d6eaf6a1b53e4841503
|
data/CHANGELOG.md
CHANGED
data/lib/contact_us/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe 'Contact Us page' do
|
3
|
+
describe 'Contact Us page', :type => :feature do
|
4
4
|
|
5
5
|
after do
|
6
6
|
ActionMailer::Base.deliveries = []
|
@@ -18,11 +18,11 @@ describe 'Contact Us page' do
|
|
18
18
|
it 'displays default contact form properly' do
|
19
19
|
visit contact_us_path
|
20
20
|
within "form#new_contact_us_contact" do
|
21
|
-
page.
|
22
|
-
page.
|
23
|
-
page.
|
24
|
-
page.
|
25
|
-
page.
|
21
|
+
expect(page).to have_selector "input#contact_us_contact_email"
|
22
|
+
expect(page).to have_selector "textarea#contact_us_contact_message"
|
23
|
+
expect(page).not_to have_selector "input#contact_us_contact_name"
|
24
|
+
expect(page).not_to have_selector "input#contact_us_contact_subject"
|
25
|
+
expect(page).to have_selector "input.submit"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -40,18 +40,18 @@ describe 'Contact Us page' do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it "I should be redirected to the homepage" do
|
43
|
-
current_path.
|
43
|
+
expect(current_path).to eq("/")
|
44
44
|
end
|
45
45
|
|
46
46
|
it "An email should have been sent" do
|
47
|
-
ActionMailer::Base.deliveries.size.
|
47
|
+
expect(ActionMailer::Base.deliveries.size).to eq(1)
|
48
48
|
end
|
49
49
|
|
50
50
|
it "The email should have the correct attributes" do
|
51
51
|
mail = ActionMailer::Base.deliveries.last
|
52
|
-
mail.to.
|
53
|
-
mail.from.
|
54
|
-
mail.body.
|
52
|
+
expect(mail.to).to eq(['test@test.com'])
|
53
|
+
expect(mail.from).to eq(['test@example.com'])
|
54
|
+
expect(mail.body).to match 'howdy'
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -65,15 +65,15 @@ describe 'Contact Us page' do
|
|
65
65
|
|
66
66
|
it "I should see two error messages" do
|
67
67
|
within '#contact_us_contact_email_input' do
|
68
|
-
page.
|
68
|
+
expect(page).to have_content "is invalid"
|
69
69
|
end
|
70
70
|
within '#contact_us_contact_message_input' do
|
71
|
-
page.
|
71
|
+
expect(page).to have_content "can't be blank"
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
75
|
it "An email should not have been sent" do
|
76
|
-
ActionMailer::Base.deliveries.size.
|
76
|
+
expect(ActionMailer::Base.deliveries.size).to eq(0)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
@@ -88,8 +88,8 @@ describe 'Contact Us page' do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it "displays an input for name and subject" do
|
91
|
-
page.
|
92
|
-
page.
|
91
|
+
expect(page).to have_selector "input#contact_us_contact_name"
|
92
|
+
expect(page).to have_selector "input#contact_us_contact_subject"
|
93
93
|
end
|
94
94
|
|
95
95
|
context "Submitting the form" do
|
@@ -103,20 +103,20 @@ describe 'Contact Us page' do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it "I should be redirected to the homepage" do
|
106
|
-
current_path.
|
106
|
+
expect(current_path).to eq("/")
|
107
107
|
end
|
108
108
|
|
109
109
|
it "An email should have been sent" do
|
110
|
-
ActionMailer::Base.deliveries.size.
|
110
|
+
expect(ActionMailer::Base.deliveries.size).to eq(1)
|
111
111
|
end
|
112
112
|
|
113
113
|
it "The email should have the correct attributes" do
|
114
114
|
mail = ActionMailer::Base.deliveries.last
|
115
|
-
mail.body.
|
116
|
-
mail.body.
|
117
|
-
mail.from.
|
118
|
-
mail.subject.
|
119
|
-
mail.to.
|
115
|
+
expect(mail.body).to match 'howdy'
|
116
|
+
expect(mail.body).to match 'Jeff'
|
117
|
+
expect(mail.from).to eq(['test@example.com'])
|
118
|
+
expect(mail.subject).to match 'Testing contact form.'
|
119
|
+
expect(mail.to).to eq(['test@test.com'])
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -127,15 +127,15 @@ describe 'Contact Us page' do
|
|
127
127
|
|
128
128
|
it "I should see error messages" do
|
129
129
|
within '#contact_us_contact_name_input' do
|
130
|
-
page.
|
130
|
+
expect(page).to have_content "can't be blank"
|
131
131
|
end
|
132
132
|
within '#contact_us_contact_subject_input' do
|
133
|
-
page.
|
133
|
+
expect(page).to have_content "can't be blank"
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
137
|
it "An email should not have been sent" do
|
138
|
-
ActionMailer::Base.deliveries.size.
|
138
|
+
expect(ActionMailer::Base.deliveries.size).to eq(0)
|
139
139
|
end
|
140
140
|
end
|
141
141
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contact_us
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Dutil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -269,4 +269,3 @@ test_files:
|
|
269
269
|
- spec/models/contact_us/contact_spec.rb
|
270
270
|
- spec/spec_helper.rb
|
271
271
|
- spec/support/active_model_lint.rb
|
272
|
-
has_rdoc:
|