Sha256: baa7c79e69c4ead8dbaba9f2be6790d5cc9a855d6debf60b6553670a1cbb329f
Contents?: true
Size: 1.41 KB
Versions: 5
Compression:
Stored size: 1.41 KB
Contents
require 'test_helper' module ApplicationTests class RouterTest < ActionController::TestCase tests MusicianController context "A Rails app" do should "pass url_helpers to the cell instance" do assert_equal "/", BassistCell.new(@controller).root_path end should "allow cells to use url_helpers" do BassistCell.class_eval do def promote; render; end end get "index" assert_response :success assert_equal "Find me at <a href=\"/musician\">vd.com</a>", @response.body end should "delegate #url_options to the parent_controller" do @controller.instance_eval do def default_url_options {:host => "cells.rails.org"} end end assert_equal "http://cells.rails.org/", BassistCell.new(@controller).root_url end should "allow cells to use *_url helpers when mixing in AC::UrlFor" do get "promote" assert_response :success assert_equal "Find me at <a href=\"http://test.host/\">vd.com</a>\n", @response.body end should "allow cells to use #config" do BassistCell.class_eval do def provoke; render; end end get "promotion" assert_response :success assert_equal "That's me, naked <img alt=\"Me\" src=\"/images/me.png\" />", @response.body end end end end
Version data entries
5 entries across 5 versions & 1 rubygems