From d98f623938806be3e95fbcaf4b4129e62c903bd1 Mon Sep 17 00:00:00 2001 From: Andrew Haines Date: Fri, 16 Nov 2012 11:55:34 +0000 Subject: [PATCH] Fix rbx --- .travis.yml | 1 - spec/integration/integration_spec.rb | 52 +++++++++++----------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index 08b236c..50e9441 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,4 @@ rvm: - ruby-head matrix: allow_failures: - - rvm: rbx-19mode - rvm: ruby-head diff --git a/spec/integration/integration_spec.rb b/spec/integration/integration_spec.rb index 42343e6..b18846b 100644 --- a/spec/integration/integration_spec.rb +++ b/spec/integration/integration_spec.rb @@ -2,44 +2,32 @@ require 'spec_helper' require 'support/dummy_app' require 'support/matchers/have_text' -shared_examples_for "a decorator in a view" do - it "works" do - # it runs in the correct environment - page.should have_text(environment).in("#environment") +app = DummyApp.new(ENV["RAILS_ENV"]) - # it can use path helpers with a model - page.should have_text("/en/posts/1").in("#path_with_model") +app.start_server do + {view: "/posts/1", mailer: "/posts/1/mail"}.each do |type, path| + page = app.get(path) - # it can use path helpers with an id - page.should have_text("/en/posts/1").in("#path_with_id") - - # it can use url helpers with a model - page.should have_text("http://www.example.com/en/posts/1").in("#url_with_model") - - # it can use url helpers with an id - page.should have_text("http://www.example.com/en/posts/1").in("#url_with_id") - end -end - -describe "integration" do - app = DummyApp.new(ENV["RAILS_ENV"]) - - app.start_server do - describe "in #{app.environment}" do - let(:environment) { app.environment } - - context "in a view" do - let(:page) { app.get("/posts/1") } - - it_behaves_like "a decorator in a view" + describe "in a #{type}" do + it "runs in the correct environment" do + page.should have_text(app.environment).in("#environment") end - context "in a mailer" do - let(:page) { app.get("/posts/1/mail") } + it "can use path helpers with a model" do + page.should have_text("/en/posts/1").in("#path_with_model") + end - it_behaves_like "a decorator in a view" + it "can use path helpers with an id" do + page.should have_text("/en/posts/1").in("#path_with_id") + end + + it "can use url helpers with a model" do + page.should have_text("http://www.example.com/en/posts/1").in("#url_with_model") + end + + it "can use url helpers with an id" do + page.should have_text("http://www.example.com/en/posts/1").in("#url_with_id") end end end - end