Sha256: 59e6016b68fd04f40cb21409f5313159a887cece18f20ac7c2e9e9abbf3a7f64

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

require 'spec_helper'

describe ForceFallbackController do
  render_views

  it "should find the correct view (mobile) when it exists" do
    force_mobile_request_agent
    get :index
    response.should render_template(:index)
    response.body.should contain("MOBILE VIEW")
  end

  it "should find the correct view (html) when it exists" do
    reset_test_request_agent
    get :index
    response.should render_template(:index)
    response.body.should contain("HTML VIEW")
  end

  it "should fall back to the JS format when it doesnt have mobile" do
    force_mobile_request_agent
    get :test
    response.should render_template(:test)
    response.body.should contain("JS VIEW")
  end

  it "should fall back to the JS format when it doesnt have mobile" do
    force_mobile_request_agent
    get :test, :format => :html
    response.should render_template(:test)
    response.body.should contain("JS VIEW")
  end

  it "should fall back to the JS format when it doesnt (js)" do
    force_mobile_request_agent
    get :test, :format => :js
    response.should render_template(:test)
    response.body.should contain("JS VIEW")
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mobylette-1.4.0 spec/controllers/force_fallback_controller_spec.rb
mobylette-1.3.0 spec/controllers/force_fallback_controller_spec.rb
mobylette-1.2.2 spec/controllers/force_fallback_controller_spec.rb
mobylette-1.2.1 spec/controllers/force_fallback_controller_spec.rb
mobylette-1.2.0 spec/controllers/force_fallback_controller_spec.rb
mobylette-1.1.0 spec/controllers/force_fallback_controller_spec.rb
mobylette-1.0.0 spec/controllers/force_fallback_controller_spec.rb