Created
May 19, 2011 14:25
-
-
Save elricstorm/980857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When requesting mobile you can set the request environment two ways | |
# @request.env['HTTP_ACCEPT'] = "mobile" | |
# OR | |
# @request.accept = "mobile" | |
require 'test_helper' | |
class HomeControllerTest < ActionController::TestCase | |
test "should get mobile index" do | |
@request.accept = "mobile" | |
get :index | |
assert_response :success | |
assert_select "div[data-role=header]" do | |
assert_select 'h1', 'Your Header Title' | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-role="header"> | |
<h1>Your Header Title</h1> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mime::Type.register_alias "text/html", :mobile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment