Skip to content
This repository
Browse code

Reset content_path and layout after running specs

  • Loading branch information...
commit d4ba056415bb57f34d1ee8596e8cdd25b6508c33 1 parent e4b1ce9
Matthew Horan mhoran authored
10 spec/controllers/pages_controller_spec.rb
@@ -43,9 +43,14 @@
43 43
44 44 context "using custom layout" do
45 45 before(:all) do
  46 + @original_layout = HighVoltage::layout
46 47 HighVoltage::layout = "alternate"
47 48 end
48 49
  50 + after(:all) do
  51 + HighVoltage::layout = @original_layout
  52 + end
  53 +
49 54 describe "on GET to /pages/exists" do
50 55 before { get :show, :id => "exists" }
51 56
@@ -58,9 +63,14 @@
58 63
59 64 context "using custom content path" do
60 65 before(:all) do
  66 + @original_content_path = HighVoltage::content_path
61 67 HighVoltage::content_path = "other_pages/"
62 68 end
63 69
  70 + after(:all) do
  71 + HighVoltage::content_path = @original_content_path
  72 + end
  73 +
64 74 describe "on GET to /other_pages/also_exists" do
65 75 before { get :show, :id => 'also_exists' }
66 76
6 spec/routing/routes_spec.rb
@@ -30,10 +30,16 @@
30 30 context "using a custom content_path" do
31 31
32 32 before(:all) do
  33 + @original_content_path = HighVoltage::content_path
33 34 HighVoltage::content_path = "other_pages/"
34 35 Rails.application.reload_routes!
35 36 end
36 37
  38 + after(:all) do
  39 + HighVoltage::content_path = @original_content_path
  40 + Rails.application.reload_routes!
  41 + end
  42 +
37 43 it "should generate normal resource route with id" do
38 44 page_path(:id => "one").should == "/other_pages/one"
39 45 end

0 comments on commit d4ba056

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