Sha256: 62bd555137ddf9925d57b7699831c5e13a0cacbf82ef0d081d5f040fd6cf5b5c

Contents?: true

Size: 1.43 KB

Versions: 16

Compression:

Stored size: 1.43 KB

Contents

# -*- coding: utf-8 -*-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))

describe MobileSpecController do
  describe "GET 'index'" do
    context 'PC access' do
      it "should be successful" do
        request.user_agent = 'Mozilla'
        get 'index'

        response.should be_success
        response.should render_template('index')
        request.mobile?.should be_false
      end
    end

    context 'mobile access' do
      it "should be successful" do
        request.user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
        get 'index'
        response.should be_success
        response.should render_template('index_mobile')
        request.mobile?.should be_true
        request.mobile.should be_a(Jpmobile::Mobile::Docomo)
      end
    end
  end

  describe "GET 'file_render'" do
    context 'PC access' do
      it "should be successful" do
        request.user_agent = 'Mozilla'
        get 'file_render'

        response.should be_success
        response.should render_template('422')
        request.mobile?.should be_false
      end
    end

    context 'mobile access' do
      it "should be successful" do
        request.user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
        get 'file_render'
        response.should be_success
        response.should render_template('422')
        request.mobile?.should be_true
        request.mobile.should be_a(Jpmobile::Mobile::Docomo)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
jpmobile-3.0.9 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.8 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.7 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-2.0.11 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-2.0.10 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.6 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-2.0.9 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.5 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-2.0.8 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.4 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.3 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.2 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.1 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-2.0.7 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-2.0.6 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
jpmobile-3.0.0 test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb