Sha256: 707671964bc9f87c2e4e122d96fb120d48ad9b3b4583666115f1a8e15320682e

Contents?: true

Size: 840 Bytes

Versions: 14

Compression:

Stored size: 840 Bytes

Contents

require 'rails_helper'

describe 'PCからのアクセスの場合', type: :request do
  before do
    @headers = {
      'HTTP_USER_AGENT' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)',
    }
  end

  it 'request.mobile は nil であるべき' do
    get '/mobile_spec/index', params: {}, env: @headers

    expect(request.mobile).to be_nil
  end
  it 'request.mobile? は false であるべき' do
    get '/mobile_spec/index', params: {}, env: @headers

    expect(request.mobile?).to be_falsey
  end

  context 'routesが存在しない場合' do
    it 'ActionController::RoutingErrorをraiseする' do
      expect { get '/not_exist', params: {}, env: @headers }.to raise_error ActionController::RoutingError
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
jpmobile-7.0.4 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-7.0.3 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-7.0.2 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-7.0.1 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-7.0.0 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-6.1.2 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-6.1.1 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-6.1.0 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-6.0.0 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-5.2.5 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-6.0.0.beta test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-5.2.4 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-5.2.3 test/rails/overrides/spec/requests/pc_spec.rb
jpmobile-5.2.2 test/rails/overrides/spec/requests/pc_spec.rb