Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adds guardfile and fixes specs.

  • Loading branch information...
commit c356a122484f72427e18b07bcdf009a7dfec0b8a 1 parent a971e7d
Rob Yurkowski authored February 03, 2012
20  Guardfile
... ...
@@ -0,0 +1,20 @@
  1
+guard 'rspec', :version => 2, :cli => "--format Fuubar --color --drb" do
  2
+  watch(%r{^spec/.+_spec\.rb$})
  3
+  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  4
+  watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_spec.rb" }
  5
+  watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/controllers/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
  6
+  watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  7
+  watch('spec/spec_helper.rb')                        { "spec" }
  8
+  watch('config/routes.rb')                           { "spec/routing" }
  9
+  watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  10
+  # Capybara request specs
  11
+  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/requests/#{m[1]}_spec.rb" }
  12
+end
  13
+
  14
+guard 'spork', :wait => 60, :cucumber => false, :rspec_env => { 'RAILS_ENV' => 'test' } do
  15
+  watch('config/application.rb')
  16
+  watch('config/environment.rb')
  17
+  watch(%r{^config/environments/.+\.rb$})
  18
+  watch(%r{^config/initializers/.+\.rb$})
  19
+  watch('spec/spec_helper.rb')
  20
+end
2  app/controllers/refinery/inquiries/inquiries_controller.rb
@@ -30,7 +30,7 @@ def create
30 30
             end if ::Refinery::Inquiries::InquirySetting.send_confirmation?
31 31
           end
32 32
 
33  
-          redirect_to refinery.inquiries_thank_you_inquiries_path
  33
+          redirect_to refinery.thank_you_inquiries_inquiries_path
34 34
         else
35 35
           render :action => 'new'
36 36
         end
2  app/views/refinery/inquiries/inquiries/new.html.erb
@@ -26,7 +26,7 @@
26 26
       </div>
27 27
       <div class="actions">
28 28
         <%= f.submit t('.send') %>
29  
-        <%= link_to t('.privacy_policy'), "/pages/privacy-policy", :id => "privacy_link" if Refinery::Inquiries.config.show_contact_privacy_link %>
  29
+        <%= link_to t('.privacy_policy'), "/pages/privacy-policy", :id => "privacy_link" if Refinery::Inquiries.show_contact_privacy_link %>
30 30
       </div>
31 31
     <% end %>
32 32
   </div>
4  lib/refinery/inquiries/engine.rb
@@ -8,8 +8,8 @@ class Engine < Rails::Engine
8 8
       initializer "init plugin" do
9 9
         Refinery::Plugin.register do |plugin|
10 10
           plugin.pathname = root
11  
-          plugin.name = "refinery_inquiries"
12  
-          plugin.url = {:controller => 'refinery/inquiries/admin/inquiries'}
  11
+          plugin.name = "refinerycms_inquiries"
  12
+          plugin.url = {:controller => '/refinery/inquiries/admin/inquiries'}
13 13
           plugin.menu_match = %r{/refinery/inquiries(/.+?)?$}
14 14
           plugin.activity = {
15 15
             :class_name => :'refinery/inquiries/inquiry',
2  spec/requests/refinery/inquiries/admin/inquiries_spec.rb
@@ -3,7 +3,7 @@
3 3
 module Refinery
4 4
   module Inquiries
5 5
     module Admin
6  
-      describe "inquiries" do
  6
+      describe Inquiry do
7 7
         login_refinery_user
8 8
 
9 9
         let!(:inquiry) do
11  spec/requests/refinery/inquiries/inquiries_spec.rb
@@ -11,16 +11,15 @@ module Inquiries
11 11
       end
12 12
 
13 13
       context "when valid data" do
14  
-        it "is successful", :focus => true do
  14
+        it "is successful" do
15 15
           visit refinery.inquiries_new_inquiry_path
16 16
 
17 17
           fill_in "Name", :with => "Ugis Ozols"
18 18
           fill_in "Email", :with => "ugis.ozols@refinerycms.com"
19 19
           fill_in "Message", :with => "Hey, I'm testing!"
20  
-          save_and_open_page
21 20
           click_button "Send message"
22 21
 
23  
-          page.current_path.should == inquiries_thank_you_inquiries_path
  22
+          page.current_path.should == refinery.thank_you_inquiries_inquiries_path
24 23
           page.should have_content("Thank You")
25 24
 
26 25
           within "#body_content_left" do
@@ -39,7 +38,7 @@ module Inquiries
39 38
 
40 39
           click_button "Send message"
41 40
 
42  
-          page.current_path.should == inquiries_new_inquiry_path
  41
+          page.current_path.should == refinery.inquiries_new_inquiry_path
43 42
           page.should have_content("There were problems with the following fields")
44 43
           page.should have_content("Name can't be blank")
45 44
           page.should have_content("Email is invalid")
@@ -52,6 +51,10 @@ module Inquiries
52 51
 
53 52
       describe "privacy" do
54 53
         context "when show contact privacy link setting set to false" do
  54
+          before(:each) do
  55
+            Refinery::Inquiries.stub(:show_contact_privacy_link).and_return(false)
  56
+          end
  57
+
55 58
           it "won't show link" do
56 59
             visit refinery.inquiries_new_inquiry_path
57 60
 

0 notes on commit c356a12

Please sign in to comment.
Something went wrong with that request. Please try again.