spec/optionsful_server_spec.rb in optionsful-0.5.1 vs spec/optionsful_server_spec.rb in optionsful-0.5.2

- old
+ new

@@ -411,10 +411,14 @@ end context "the Link header" do describe "should NOT be present" do + + before(:all) do + backup_configuration_file + end before(:each) do rails_app.routes.draw do resources :posts end @@ -429,20 +433,24 @@ end after(:each) do Rails.application.reload_routes! end + + after(:all) do + restore_configuration_file + end end describe "behave arbitrarily if directions were given" do before(:all) do rails_app.routes.draw do resources :posts end - delete_configuration_file + backup_configuration_file end before(:each) do delete_configuration_file end @@ -490,15 +498,12 @@ response[0].should be 204 link = response[1]["Link"] link.should match /\A\"<http:\/\/www.baurets.net\/api\/posts.+\"\z/ end - after(:each) do - delete_configuration_file - end - after(:all) do Rails.application.reload_routes! + restore_configuration_file end end end