2012-11-12 02:01:49 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
require 'support/dummy_app'
|
2012-11-16 05:11:53 -05:00
|
|
|
require 'support/matchers/have_text'
|
2012-11-12 02:01:49 -05:00
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
app = DummyApp.new(ENV["RAILS_ENV"])
|
2012-11-13 15:28:15 -05:00
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
app.start_server do
|
|
|
|
{view: "/posts/1", mailer: "/posts/1/mail"}.each do |type, path|
|
|
|
|
page = app.get(path)
|
2012-11-13 15:28:15 -05:00
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
describe "in a #{type}" do
|
|
|
|
it "runs in the correct environment" do
|
|
|
|
page.should have_text(app.environment).in("#environment")
|
|
|
|
end
|
2012-11-12 02:01:49 -05:00
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
it "can use path helpers with a model" do
|
|
|
|
page.should have_text("/en/posts/1").in("#path_with_model")
|
|
|
|
end
|
2012-11-12 02:01:49 -05:00
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
it "can use path helpers with an id" do
|
|
|
|
page.should have_text("/en/posts/1").in("#path_with_id")
|
2012-11-12 02:01:49 -05:00
|
|
|
end
|
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
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
|
2012-11-12 02:01:49 -05:00
|
|
|
|
2012-11-16 06:55:34 -05:00
|
|
|
it "can use url helpers with an id" do
|
|
|
|
page.should have_text("http://www.example.com/en/posts/1").in("#url_with_id")
|
2012-11-12 02:01:49 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|