Sha256: 9b122a749b40685df9aa017b763ed66fc7450feb1c32af0dc0f24eb8dbfb24ad

Contents?: true

Size: 935 Bytes

Versions: 14

Compression:

Stored size: 935 Bytes

Contents

require 'rails_helper'

describe Admin::TopController, type: :feature do
  describe "GET 'full_path'" do
    before do
      page.driver.header('user_agent', user_agent)
    end

    context 'PCからのアクセスの場合' do
      let(:user_agent) do
        '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 '_partial.html.erbが使用されること' do
        visit '/admin/top/full_path'

        expect(page).to have_content('_partial.html.erb')
      end
    end

    context 'DoCoMoからのアクセスの場合' do
      let(:user_agent) do
        'DoCoMo/2.0 SH902i(c100;TB;W24H12)'
      end
      it '_partial_mobile_docomo.html.erbが使用されること' do
        visit '/admin/top/full_path'

        expect(page).to have_content('_partial_mobile_docomo.html.erb')
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
jpmobile-6.1.2 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-6.1.1 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-6.1.0 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-6.0.0 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.2.5 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-6.0.0.beta test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.2.4 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.0.1 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.1.1 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.2.3 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.2.2 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.2.1 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.2.0 test/rails/overrides/spec/features/admin/top_spec.rb
jpmobile-5.1.0 test/rails/overrides/spec/features/admin/top_spec.rb