dugway 1.0.0 → 1.0.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
  SHA256:
3
- metadata.gz: 2625aace16555a5b683e997a7a0e445ba02a07418eb40b711ea03604c8a82c2b
4
- data.tar.gz: 28e23d4592a86308e3297a6595077913585e8108cfd8ad41dda633ccea57cca6
3
+ metadata.gz: 164c11d13a392a70b8827996b897125e0669211fe85cb5463445d86d41d53a4d
4
+ data.tar.gz: e4d2171b77593472fc50be05842b091d83c4c0c6fa28d2ebe9e7c54de9bc115a
5
5
  SHA512:
6
- metadata.gz: 93c9c354790dca5dbcc2f14a4bb8c5b75ae82c43283f27c8a1c2509478b9c75c6583f315b247cc7e82aa793ee476d67ae19c6c489cf9bb5e5f3c3a79d09f8097
7
- data.tar.gz: 75fd66e26e0b8d5490c7dd066d734d794f5df9f2cb5babc873bf18f539abea836a5b7a70347efbb1051b46f95469381e499e29db4e33c9a7a5dbf2d0a7fcff33
6
+ metadata.gz: 935b7f6c7af148e55df7a3f20e52a37d0aa317f3033f991a4c1f21a9d03b0c5fc6665658e4990c7d293b64203fde70e68e23dce3be750477da0802ab1848ef31
7
+ data.tar.gz: 5f85b9baa1c340cead3ad92b503d90cb619f3b66e9a08bec983300df80a7ec057c3651b681c29e1cb4beacf569961322638a0ec52bce21add32aeed550567043
@@ -22,14 +22,9 @@
22
22
  <label for="message">Message</label>
23
23
  {{ contact | contact_input: 'message' }}
24
24
  </li>
25
- <li>
26
- <label for="captcha">Spam check</label>
27
- <p>Please enter the characters from the image.</p>
28
- <div>{{ contact.captcha }}</div>
29
- {{ contact | contact_input: 'captcha' }}
30
- </li>
31
25
  <li>
32
26
  <button type="submit" name="submit" title="Send us an email">Send</button>
27
+ <div>{{ contact.recaptcha }}</div>
33
28
  </li>
34
29
  </ul>
35
30
  </form>
@@ -12,25 +12,19 @@ module Dugway
12
12
  'All fields are required'
13
13
  elsif param_does_not_match(:email, email_format)
14
14
  'Invalid email address'
15
- elsif param_does_not_match(:captcha, captcha_format)
16
- 'Spam check was incorrect'
17
15
  end
18
16
  end
19
17
 
20
18
  private
21
19
 
22
20
  def required_fields
23
- [ :name, :email, :subject, :message, :captcha ]
21
+ [ :name, :email, :subject, :message ]
24
22
  end
25
23
 
26
24
  def email_format
27
25
  /^([^@\s]+)@((?:[-a-zA-Z0-9]+\.)+[a-zA-Z]{2,})$/
28
26
  end
29
27
 
30
- def captcha_format
31
- /^rQ9pC$/i
32
- end
33
-
34
28
  def param_does_not_match(param_name, regex)
35
29
  !(params[param_name.to_sym] =~ regex)
36
30
  end
@@ -1,3 +1,3 @@
1
1
  module Dugway
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -16,18 +16,12 @@ feature 'Contact form' do
16
16
  expect(page).to have_content('Invalid email address')
17
17
  end
18
18
 
19
- scenario 'with an invalid captcha' do
20
- submit_contact_form(:captcha => 'blah')
21
- expect(page).to have_content('Spam check was incorrect')
22
- end
23
-
24
19
  def submit_contact_form(fields={})
25
20
  fields.reverse_merge!(
26
21
  :name => 'Joe',
27
22
  :email => 'joe@example.com',
28
23
  :subject => 'Testing',
29
24
  :message => 'Hi there',
30
- :captcha => 'rQ9pC'
31
25
  )
32
26
 
33
27
  visit '/contact'
@@ -36,7 +30,6 @@ feature 'Contact form' do
36
30
  fill_in 'Email', :with => fields[:email]
37
31
  fill_in 'Subject', :with => fields[:subject]
38
32
  fill_in 'Message', :with => fields[:message]
39
- fill_in 'Spam check', :with => fields[:captcha]
40
33
 
41
34
  click_button 'Send'
42
35
  end
@@ -50,7 +50,7 @@ feature 'Page rendering' do
50
50
  visit '/contact'
51
51
  expect(page).to have_content('Dugway') # layout.html
52
52
  expect(page).to have_content('Contact')
53
- expect(page).to have_content('Spam check')
53
+ expect(page).to have_content('protected by reCAPTCHA')
54
54
  end
55
55
 
56
56
  scenario 'maintenance.html' do
@@ -22,14 +22,9 @@
22
22
  <label for="message">Message</label>
23
23
  {{ contact | contact_input: 'message' }}
24
24
  </li>
25
- <li>
26
- <label for="captcha">Spam check</label>
27
- <p>Please enter the characters from the image.</p>
28
- <div>{{ contact.captcha }}</div>
29
- {{ contact | contact_input: 'captcha' }}
30
- </li>
31
25
  <li>
32
26
  <button type="submit" name="submit" title="Send us an email">Send</button>
27
+ <div>{{ contact.recaptcha }}</div>
33
28
  </li>
34
29
  </ul>
35
30
  </form>
@@ -11,7 +11,6 @@ describe Dugway::ContactFormValidator do
11
11
  :email => "name@example.com",
12
12
  :subject => "subject",
13
13
  :message => "message",
14
- :captcha => "rQ9pc",
15
14
  }
16
15
  end
17
16
 
@@ -36,21 +35,11 @@ describe Dugway::ContactFormValidator do
36
35
  assert_required_fields_error
37
36
  end
38
37
 
39
- it "returns an error for a missing captcha" do
40
- validator.params[:captcha] = " "
41
- assert_required_fields_error
42
- end
43
-
44
38
  it "returns an error for invalid email format" do
45
39
  validator.params[:email] = "foo-at-foo-dot-net"
46
40
  expect(validator.error_message).to eq "Invalid email address"
47
41
  end
48
42
 
49
- it "returns an error for incorrect captcha" do
50
- validator.params[:captcha] = "oops"
51
- expect(validator.error_message).to eq "Spam check was incorrect"
52
- end
53
-
54
43
  def assert_required_fields_error
55
44
  expect(validator.error_message).to eql "All fields are required"
56
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dugway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Big Cartel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2020-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler