contact_us 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
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.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
- # To deal with the form, model must respond to #to_key
30
- def to_key; end
24
+
25
+ def persisted?
26
+ false
27
+ end
31
28
 
32
29
  end
@@ -1,3 +1,3 @@
1
- <p><%= @message %><p>
1
+ <p><%= @message %></p>
2
2
  <p>---------------------</p>
3
3
  <p><%= t('.sent_by_contact_form') %></p>
@@ -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 %>
@@ -1,3 +1,3 @@
1
1
  module ContactUs
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end