Sha256: cf03f43acd19c077c158225a60c343b5a27ef094a9f8effdc4557313ddd504eb

Contents?: true

Size: 1016 Bytes

Versions: 1

Compression:

Stored size: 1016 Bytes

Contents

require 'rails_helper'

describe "DoCoMo SH902i からのアクセス" do
  it "request.mobile は Docomo のインスタンスであるべき" do
    get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}

    request.mobile.should be_an_instance_of(Jpmobile::Mobile::Docomo)
  end
  it "request.mobile? は true であるべき" do
    get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}

    request.mobile?.should be_truthy
  end
end

describe "DoCoMo SH902i からguid付きのアクセス" do
  before(:each) do
    @headers = {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)", 'HTTP_X_DCMGUID' => "000000a"}
  end

  it "guidを正しく取得できること" do
    get "/mobile_spec/index", {}, @headers

    request.mobile.guid.should == "000000a"
  end
  it "ident_subscriberでも正しく取得できること" do
    get "/mobile_spec/index", {}, @headers

    request.mobile.ident_subscriber.should == "000000a"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jpmobile-4.1.1 test/rails/overrides/spec/requests/docomo_spec.rb