Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reset content_path and layout after running specs

  • Loading branch information...
commit d4ba056415bb57f34d1ee8596e8cdd25b6508c33 1 parent e4b1ce9
@mhoran mhoran authored
View
10 spec/controllers/pages_controller_spec.rb
@@ -43,9 +43,14 @@
context "using custom layout" do
before(:all) do
+ @original_layout = HighVoltage::layout
HighVoltage::layout = "alternate"
end
+ after(:all) do
+ HighVoltage::layout = @original_layout
+ end
+
describe "on GET to /pages/exists" do
before { get :show, :id => "exists" }
@@ -58,9 +63,14 @@
context "using custom content path" do
before(:all) do
+ @original_content_path = HighVoltage::content_path
HighVoltage::content_path = "other_pages/"
end
+ after(:all) do
+ HighVoltage::content_path = @original_content_path
+ end
+
describe "on GET to /other_pages/also_exists" do
before { get :show, :id => 'also_exists' }
View
6 spec/routing/routes_spec.rb
@@ -30,10 +30,16 @@
context "using a custom content_path" do
before(:all) do
+ @original_content_path = HighVoltage::content_path
HighVoltage::content_path = "other_pages/"
Rails.application.reload_routes!
end
+ after(:all) do
+ HighVoltage::content_path = @original_content_path
+ Rails.application.reload_routes!
+ end
+
it "should generate normal resource route with id" do
page_path(:id => "one").should == "/other_pages/one"
end
Please sign in to comment.
Something went wrong with that request. Please try again.