Permalink
Browse files

Adds guardfile and fixes specs.

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

0 comments on commit c356a12

Please sign in to comment.