contact_us 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +7 -1
- data/app/models/contact_us/contact.rb +5 -8
- data/app/views/contact_us/contact_mailer/contact_email.html.erb +1 -1
- data/app/views/contact_us/contacts/new.html.erb +1 -1
- data/lib/contact_us/version.rb +1 -1
- data/spec/dummy/log/test.log +292 -14923
- data/spec/integration/contact_us_lint_spec.rb +70 -0
- data/spec/mailers/contact_us/contact_mailer_spec.rb +1 -1
- data/spec/models/contact_us/contact_spec.rb +1 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/support/active_model_lint.rb +17 -0
- metadata +9 -21
- data/spec/dummy/Gemfile.lock +0 -86
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -9
- data/spec/dummy/log/production.log +0 -0
- data/spec/dummy/log/server.log +0 -0
- data/spec/integration/navigation_spec.rb +0 -73
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Contact Us requires the Formtastic Gem. Read more about Formtastic @ https://gi
|
|
12
12
|
|
13
13
|
In your `Gemfile`, add the following dependencies:
|
14
14
|
|
15
|
-
gem 'contact_us', '~> 0.1.
|
15
|
+
gem 'contact_us', '~> 0.1.2'
|
16
16
|
|
17
17
|
From `Rails.root` run:
|
18
18
|
|
@@ -37,6 +37,12 @@ You may also update your locales under `config/locales/contact_us.en.yml` or cre
|
|
37
37
|
|
38
38
|
Visit your website and navigate to `/contact_us` to see the form in action.
|
39
39
|
|
40
|
+
## INTEGRATION TESTS
|
41
|
+
|
42
|
+
Contact Us has 100% test coverage, and provides simple integration specs you can drop directly into your apps test suite if you use RSpec & Capybara.
|
43
|
+
|
44
|
+
Simply copy the `spec/integration/contact_us_lint_spec.rb` file, and add it to your integration specs.
|
45
|
+
|
40
46
|
## ISSUES
|
41
47
|
|
42
48
|
Please report any bugs or feature requests to the Github issues page @ https://github.com/jdutil/contact_us/issues
|
@@ -1,4 +1,5 @@
|
|
1
1
|
class ContactUs::Contact
|
2
|
+
include ActiveModel::Conversion
|
2
3
|
include ActiveModel::Validations
|
3
4
|
|
4
5
|
attr_accessor :email, :message
|
@@ -11,11 +12,6 @@ class ContactUs::Contact
|
|
11
12
|
attributes.each do |key, value|
|
12
13
|
self.send("#{key}=", value)
|
13
14
|
end
|
14
|
-
@attributes = attributes
|
15
|
-
end
|
16
|
-
|
17
|
-
def read_attribute_for_validation(key)
|
18
|
-
@attributes[key]
|
19
15
|
end
|
20
16
|
|
21
17
|
def save
|
@@ -25,8 +21,9 @@ class ContactUs::Contact
|
|
25
21
|
end
|
26
22
|
return false
|
27
23
|
end
|
28
|
-
|
29
|
-
|
30
|
-
|
24
|
+
|
25
|
+
def persisted?
|
26
|
+
false
|
27
|
+
end
|
31
28
|
|
32
29
|
end
|
@@ -2,5 +2,5 @@
|
|
2
2
|
<%= semantic_form_for @contact, :url => contacts_path do |f| %>
|
3
3
|
<%= f.input :email, :label => t('.email') %>
|
4
4
|
<%= f.input :message, :as => :text, :label => t('.message') %>
|
5
|
-
<%= f.commit_button t('.submit'), :button_html => { :alt => t('.submit'), :title => t('.submit') } %>
|
5
|
+
<%= f.commit_button t('.submit'), :button_html => { :alt => t('.submit'), :id => 'contact_us_contact_submit', :title => t('.submit') } %>
|
6
6
|
<% end %>
|
data/lib/contact_us/version.rb
CHANGED