jpmobile 0.0.8 → 0.1.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +0 -3
- data/{spec/spec.opts → .rspec} +1 -2
- data/README.rdoc +122 -128
- data/Rakefile +23 -101
- data/VERSION.yml +4 -3
- data/jpmobile.gemspec +130 -182
- data/lib/jpmobile.rb +37 -24
- data/lib/jpmobile/docomo_guid.rb +2 -1
- data/lib/jpmobile/email.rb +3 -4
- data/lib/jpmobile/emoticon.rb +2 -6
- data/lib/jpmobile/encoding.rb +29 -0
- data/lib/jpmobile/filter.rb +42 -134
- data/lib/jpmobile/helpers.rb +5 -18
- data/lib/jpmobile/hook_action_controller.rb +24 -16
- data/lib/jpmobile/hook_action_view.rb +28 -89
- data/lib/jpmobile/mobile/abstract_mobile.rb +21 -4
- data/lib/jpmobile/mobile/android.rb +10 -0
- data/lib/jpmobile/mobile/au.rb +28 -3
- data/lib/jpmobile/mobile/ddipocket.rb +12 -0
- data/lib/jpmobile/mobile/display.rb +29 -26
- data/lib/jpmobile/mobile/docomo.rb +38 -12
- data/lib/jpmobile/mobile/iphone.rb +26 -0
- data/lib/jpmobile/mobile/smart_phone.rb +21 -0
- data/lib/jpmobile/mobile/softbank.rb +16 -41
- data/lib/jpmobile/mobile/vodafone.rb +17 -0
- data/lib/jpmobile/mobile/willcom.rb +1 -10
- data/lib/jpmobile/mobile/windows_phone.rb +10 -0
- data/lib/jpmobile/position.rb +4 -3
- data/lib/jpmobile/rack.rb +43 -0
- data/lib/jpmobile/rack/filter.rb +51 -0
- data/lib/jpmobile/rack/mobile_carrier.rb +33 -0
- data/lib/jpmobile/rack/params_filter.rb +47 -0
- data/lib/jpmobile/rails.rb +22 -0
- data/lib/jpmobile/request_with_mobile.rb +8 -12
- data/lib/jpmobile/trans_sid.rb +44 -26
- data/lib/jpmobile/util.rb +68 -0
- data/{tasks → lib/tasks}/jpmobile_tasks.rake +32 -13
- data/spec/rack/jpmobile/android_spec.rb +20 -0
- data/spec/rack/jpmobile/au_spec.rb +206 -0
- data/spec/rack/jpmobile/docomo_spec.rb +237 -0
- data/spec/rack/jpmobile/emoticon_spec.rb +215 -0
- data/spec/rack/jpmobile/filter_spec.rb +181 -0
- data/spec/rack/jpmobile/iphone_spec.rb +32 -0
- data/spec/rack/jpmobile/mobile_by_ua_spec.rb +39 -0
- data/spec/rack/jpmobile/params_filter_spec.rb +193 -0
- data/spec/rack/jpmobile/softbank_spec.rb +123 -0
- data/spec/rack/jpmobile/willcom_spec.rb +67 -0
- data/spec/rack/jpmobile/windows_phone.rb +20 -0
- data/spec/rack_helper.rb +86 -0
- data/spec/spec_helper.rb +3 -2
- data/spec/unit/detect_by_email_spec.rb +21 -27
- data/spec/unit/is_carrier_spec.rb +56 -84
- data/spec/unit/spec_helper.rb +1 -2
- data/spec/unit/util_spec.rb +2 -2
- data/spec/unit/valid_ip_spec.rb +43 -52
- data/test/legacy/autoload_test.rb +1 -3
- data/test/legacy/emoticon_test.rb +5 -6
- data/test/legacy/helper.rb +0 -71
- data/test/rails/overrides/.rspec +5 -0
- data/test/rails/overrides/Gemfile +32 -0
- data/test/rails/overrides/app/controllers/docomo_guid_always_controller.rb +3 -0
- data/test/rails/overrides/app/controllers/docomo_guid_base_controller.rb +5 -0
- data/test/rails/overrides/app/controllers/docomo_guid_docomo_controller.rb +3 -0
- data/test/rails/overrides/app/controllers/filter_controller.rb +0 -34
- data/test/rails/overrides/app/controllers/filter_controller_base.rb +19 -0
- data/test/rails/overrides/app/controllers/hankaku_filter_controller.rb +3 -0
- data/test/rails/overrides/app/controllers/links_controller.rb +28 -0
- data/test/rails/overrides/app/controllers/mobile_spec_controller.rb +1 -1
- data/test/rails/overrides/app/controllers/template_path_controller.rb +3 -0
- data/test/rails/overrides/app/controllers/trans_sid_always_and_session_off_controller.rb +4 -0
- data/test/rails/overrides/app/controllers/trans_sid_always_controller.rb +3 -0
- data/test/rails/overrides/app/controllers/trans_sid_base_controller.rb +18 -0
- data/test/rails/overrides/app/controllers/trans_sid_mobile_controller.rb +3 -0
- data/test/rails/overrides/app/controllers/trans_sid_none_controller.rb +3 -0
- data/test/rails/overrides/app/views/links/au_gps.html.erb +1 -0
- data/test/rails/overrides/app/views/links/au_location.html.erb +1 -0
- data/test/rails/overrides/app/views/links/docomo_foma_gps.html.erb +1 -0
- data/test/rails/overrides/app/views/links/docomo_openiarea.html.erb +1 -0
- data/test/rails/overrides/app/views/links/docomo_utn.html.erb +1 -0
- data/test/rails/overrides/app/views/links/link.html.erb +1 -0
- data/test/rails/overrides/app/views/links/show_all.html.erb +1 -0
- data/test/rails/overrides/app/views/links/softbank_location.html.erb +1 -0
- data/test/rails/overrides/app/views/links/willcom_location.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/_partial_smart_phone.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/_partial_smart_phone_iphone.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/index_smart_phone.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/index_smart_phone_iphone.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/show_mobile.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/show_mobile_docomo.html.erb +1 -0
- data/test/rails/overrides/autotest/discover.rb +2 -0
- data/test/rails/overrides/config/initializers/jpmobile_generator.rb +1 -0
- data/test/rails/overrides/config/routes.rb +58 -0
- data/test/rails/overrides/db/migrate/001_add_sessions_table.rb +16 -0
- data/test/rails/overrides/spec/helpers/helpers_spec.rb +2 -2
- data/test/rails/overrides/spec/{controllers → requests}/docomo_guid_spec.rb +37 -14
- data/test/rails/overrides/spec/{controllers → requests}/docomo_spec.rb +11 -8
- data/test/rails/overrides/spec/{controllers → requests}/emobile_spec.rb +24 -8
- data/test/rails/overrides/spec/requests/filter_spec.rb +171 -0
- data/test/rails/overrides/spec/requests/helpers_spec.rb +187 -0
- data/test/rails/overrides/spec/requests/pc_spec.rb +22 -0
- data/test/rails/overrides/spec/requests/softbank_emulator_spec.rb +21 -0
- data/test/rails/overrides/spec/requests/template_path_spec.rb +234 -0
- data/test/rails/overrides/spec/requests/trans_sid_spec.rb +142 -0
- data/test/rails/overrides/spec/spec_helper.rb +17 -48
- data/test/sinatra/guestbook.rb +40 -0
- data/test/sinatra/test/filter_test.rb +39 -0
- metadata +185 -312
- data/lib/jpmobile/hook_request.rb +0 -5
- data/lib/jpmobile/rack/auth.rb +0 -55
- data/lib/jpmobile/rack/combined_logger.rb +0 -54
- data/lib/jpmobile/rack/request.rb +0 -7
- data/lib/jpmobile/rack/trans_sid.rb +0 -14
- data/lib/jpmobile/version.rb +0 -9
- data/spec/unit/detect_by_ua_spec.rb +0 -40
- data/test/legacy/au_test.rb +0 -173
- data/test/legacy/docomo_test.rb +0 -187
- data/test/legacy/emoticon_functional_test.rb +0 -195
- data/test/legacy/filter_test.rb +0 -34
- data/test/legacy/helpers_test.rb +0 -217
- data/test/legacy/softbank_test.rb +0 -183
- data/test/legacy/willcom_test.rb +0 -56
- data/test/rails/2.3.2/spec/controllers/trans_sid_spec.rb +0 -99
- data/test/rails/overrides/app/controllers/docomo_guid_controller.rb +0 -13
- data/test/rails/overrides/app/controllers/trans_sid_controller.rb +0 -28
- data/test/rails/overrides/lib/tasks/rspec.rake +0 -165
- data/test/rails/overrides/spec/controllers/filter_spec.rb +0 -159
- data/test/rails/overrides/spec/controllers/pc_spec.rb +0 -13
- data/test/rails/overrides/spec/controllers/softbank_emulator_spec.rb +0 -42
- data/test/rails/overrides/spec/controllers/template_path_spec.rb +0 -117
- data/test/rails/overrides/spec/controllers/trans_sid_spec.rb +0 -117
- data/test/rails/overrides/spec/rspec.rake +0 -165
- data/test/rails/overrides/spec/spec.opts +0 -4
@@ -0,0 +1,32 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '3.0.0.beta4'
|
4
|
+
|
5
|
+
# Bundle edge Rails instead:
|
6
|
+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
7
|
+
|
8
|
+
gem 'sqlite3-ruby', :require => 'sqlite3'
|
9
|
+
|
10
|
+
gem 'geokit'
|
11
|
+
gem 'hpricot'
|
12
|
+
|
13
|
+
# Use unicorn as the web server
|
14
|
+
# gem 'unicorn'
|
15
|
+
|
16
|
+
# Deploy with Capistrano
|
17
|
+
# gem 'capistrano'
|
18
|
+
|
19
|
+
# To use debugger
|
20
|
+
# gem 'ruby-debug'
|
21
|
+
|
22
|
+
# Bundle the extra gems:
|
23
|
+
# gem 'bj'
|
24
|
+
# gem 'nokogiri', '1.4.1'
|
25
|
+
# gem 'sqlite3-ruby', :require => 'sqlite3'
|
26
|
+
# gem 'aws-s3', :require => 'aws/s3'
|
27
|
+
|
28
|
+
# Bundle gems for certain environments:
|
29
|
+
group :development, :test do
|
30
|
+
gem "rspec", "2.0.0.beta.17"
|
31
|
+
gem "rspec-rails", "2.0.0.beta.17"
|
32
|
+
end
|
@@ -1,37 +1,3 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
class FilterControllerBase < ApplicationController
|
3
|
-
def abracadabra_utf8
|
4
|
-
render :text => "アブラカダブラ"
|
5
|
-
end
|
6
|
-
def abracadabra_xhtml_utf8
|
7
|
-
response.content_type = "application/xhtml+xml"
|
8
|
-
render :text => "アブラカダブラ"
|
9
|
-
end
|
10
|
-
def index
|
11
|
-
@q = params[:q]
|
12
|
-
end
|
13
|
-
def empty
|
14
|
-
render :text => ""
|
15
|
-
end
|
16
|
-
def rawdata
|
17
|
-
send_data "アブラカダブラ", :type => 'application/octet-stream'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
1
|
class FilterController < FilterControllerBase
|
22
2
|
mobile_filter
|
23
3
|
end
|
24
|
-
|
25
|
-
class HankakuFilterController < FilterControllerBase
|
26
|
-
mobile_filter :hankaku => true
|
27
|
-
|
28
|
-
around_filter :freeze_response_body
|
29
|
-
|
30
|
-
private
|
31
|
-
def freeze_response_body
|
32
|
-
yield
|
33
|
-
if response.body.respond_to?(:freeze)
|
34
|
-
response.body.freeze
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
class FilterControllerBase < ApplicationController
|
3
|
+
def abracadabra_utf8
|
4
|
+
render :text => "アブラカダブラ"
|
5
|
+
end
|
6
|
+
def abracadabra_xhtml_utf8
|
7
|
+
response.content_type = "application/xhtml+xml"
|
8
|
+
render :text => "アブラカダブラ"
|
9
|
+
end
|
10
|
+
def index
|
11
|
+
@q = params[:q]
|
12
|
+
end
|
13
|
+
def empty
|
14
|
+
render :text => ""
|
15
|
+
end
|
16
|
+
def rawdata
|
17
|
+
send_data "アブラカダブラ", :type => 'application/octet-stream'
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class LinksController < ApplicationController
|
2
|
+
def show_all
|
3
|
+
end
|
4
|
+
|
5
|
+
def link
|
6
|
+
end
|
7
|
+
|
8
|
+
def docomo_utn
|
9
|
+
end
|
10
|
+
|
11
|
+
def docomo_openiarea
|
12
|
+
end
|
13
|
+
|
14
|
+
def docomo_foma_gps
|
15
|
+
end
|
16
|
+
|
17
|
+
def au_location
|
18
|
+
end
|
19
|
+
|
20
|
+
def au_gps
|
21
|
+
end
|
22
|
+
|
23
|
+
def softbank_location
|
24
|
+
end
|
25
|
+
|
26
|
+
def willcom_location
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
class TransSidBaseController < ApplicationController
|
3
|
+
# 事前にセッションを作成しないと trans_sid が有効にならない
|
4
|
+
before_filter :session_init
|
5
|
+
|
6
|
+
def form
|
7
|
+
render :inline=>%{<%= form_tag do %>Hello<% end %>}
|
8
|
+
end
|
9
|
+
def link
|
10
|
+
render :inline=>%{<%= link_to "linkto" %>}
|
11
|
+
end
|
12
|
+
def redirect
|
13
|
+
redirect_to('/')
|
14
|
+
end
|
15
|
+
def session_init
|
16
|
+
session[:jpmobile] = "everyleaf"
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= au_gps_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= au_location_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= docomo_foma_gps_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= docomo_openiarea_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= docomo_utn_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= get_position_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= get_position_link_to(:show_all => true) -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= softbank_location_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= willcom_location_link_to("STRING") -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h2>_partial_smart_phone.html.erb</h2>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h2>_partial_smart_phone_iphone.html.erb</h2>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>index_smart_phone.html.erb<h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>index_smart_phone_iphone.html.erb<h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>show_mobile.html.erb</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
<h1>show_mobile_docomo.html.erb</h1>
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.jpmobile.mobile_filter
|
@@ -0,0 +1,58 @@
|
|
1
|
+
RailsRoot::Application.routes.draw do |map|
|
2
|
+
# The priority is based upon order of creation:
|
3
|
+
# first created -> highest priority.
|
4
|
+
|
5
|
+
# Sample of regular route:
|
6
|
+
# match 'products/:id' => 'catalog#view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
8
|
+
|
9
|
+
# Sample of named route:
|
10
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
+
|
13
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
+
# resources :products
|
15
|
+
|
16
|
+
# Sample resource route with options:
|
17
|
+
# resources :products do
|
18
|
+
# member do
|
19
|
+
# get :short
|
20
|
+
# post :toggle
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# collection do
|
24
|
+
# get :sold
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Sample resource route with sub-resources:
|
29
|
+
# resources :products do
|
30
|
+
# resources :comments, :sales
|
31
|
+
# resource :seller
|
32
|
+
# end
|
33
|
+
|
34
|
+
# Sample resource route with more complex sub-resources
|
35
|
+
# resources :products do
|
36
|
+
# resources :comments
|
37
|
+
# resources :sales do
|
38
|
+
# get :recent, :on => :collection
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
|
42
|
+
# Sample resource route within a namespace:
|
43
|
+
# namespace :admin do
|
44
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
45
|
+
# # (app/controllers/admin/products_controller.rb)
|
46
|
+
# resources :products
|
47
|
+
# end
|
48
|
+
|
49
|
+
# You can have the root of your site routed with "root"
|
50
|
+
# just remember to delete public/index.html.
|
51
|
+
# root :to => "welcome#index"
|
52
|
+
|
53
|
+
# See how all your routes lay out with "rake routes"
|
54
|
+
|
55
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
+
match ':controller(/:action(/:id(.:format)))'
|
58
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class AddSessionsTable < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :sessions do |t|
|
4
|
+
t.string :session_id, :null => false
|
5
|
+
t.text :data
|
6
|
+
t.timestamps
|
7
|
+
end
|
8
|
+
|
9
|
+
add_index :sessions, :session_id
|
10
|
+
add_index :sessions, :updated_at
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :sessions
|
15
|
+
end
|
16
|
+
end
|
@@ -5,11 +5,11 @@ require File.dirname(__FILE__) + '/../spec_helper'
|
|
5
5
|
describe Jpmobile::Helpers do
|
6
6
|
include Jpmobile::Helpers
|
7
7
|
it "docomo_guid_link_to が guid=ON を付けたリンクを生成すること" do
|
8
|
-
docomo_guid_link_to("STRING", :controller => "
|
8
|
+
docomo_guid_link_to("STRING", :controller => "filter", :action => "rawdata").should == %{<a href="/filter/rawdata?guid=ON">STRING</a>}
|
9
9
|
end
|
10
10
|
|
11
11
|
it "softbank_location_link_to がリンク先にパラメータを含んでいても正常に動作すること" do
|
12
12
|
# http://d.hatena.ne.jp/mizincogrammer/20090123/1232702067
|
13
|
-
softbank_location_link_to("STRING", :controller => "
|
13
|
+
softbank_location_link_to("STRING", :controller => "filter", :action => "rawdata", :p => "param").should == %{<a href="location:auto?url=http://test.host/filter/rawdata&p=param">STRING</a>}
|
14
14
|
end
|
15
15
|
end
|
@@ -2,48 +2,72 @@
|
|
2
2
|
|
3
3
|
require File.dirname(__FILE__) + '/../spec_helper'
|
4
4
|
|
5
|
-
|
5
|
+
shared_examples_for "docomo_guid が起動しないとき" do
|
6
6
|
it "で link_to の自動書き換えが行われない" do
|
7
|
-
get
|
8
|
-
|
7
|
+
get "/#{@controller}/link", {}, {"HTTP_USER_AGENT" => @user_agent}
|
8
|
+
|
9
|
+
response.should have_tag('a') do |a|
|
10
|
+
a.first['href'].should match(/^\/.+?\/link$/)
|
11
|
+
end
|
9
12
|
end
|
10
13
|
end
|
11
14
|
|
12
|
-
|
15
|
+
shared_examples_for "docomo_guid が起動するとき" do
|
13
16
|
it "で link_to の自動書き換えが行われる" do
|
14
|
-
get
|
15
|
-
|
17
|
+
get "/#{@controller}/link", {}, {"HTTP_USER_AGENT" => @user_agent}
|
18
|
+
|
19
|
+
response.should have_tag('a') do |a|
|
20
|
+
a.first['href'].should match(/^\/.+?\/link\?guid=ON$/)
|
21
|
+
end
|
16
22
|
end
|
17
23
|
end
|
18
24
|
|
19
25
|
describe DocomoGuidBaseController, "という docomo_guid が有効になっていないコントローラ" do
|
20
|
-
|
26
|
+
before(:each) do
|
27
|
+
@controller = "docomo_guid_base"
|
28
|
+
@user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)"
|
29
|
+
end
|
30
|
+
|
21
31
|
it "の docomo_guid_mode は nil" do
|
32
|
+
get "/#{@controller}/link", {}, {"HTTP_USER_AGENT" => @user_agent}
|
33
|
+
|
22
34
|
controller.docomo_guid_mode.should be_nil
|
23
35
|
end
|
24
36
|
it_should_behave_like "docomo_guid が起動しないとき"
|
25
37
|
end
|
26
38
|
|
27
39
|
describe DocomoGuidAlwaysController, "という docomo_guid :always が指定されているコントローラ" do
|
28
|
-
|
29
|
-
|
40
|
+
before(:each) do
|
41
|
+
@controller = "docomo_guid_always"
|
42
|
+
@user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)"
|
43
|
+
end
|
44
|
+
|
45
|
+
it "の docomo_guid_always は :always" do
|
46
|
+
get "/#{@controller}/link", {}, {"HTTP_USER_AGENT" => @user_agent}
|
47
|
+
|
30
48
|
controller.docomo_guid_mode.should == :always
|
31
49
|
end
|
32
50
|
it_should_behave_like "docomo_guid が起動するとき"
|
33
51
|
end
|
34
52
|
|
35
53
|
describe DocomoGuidDocomoController, "という docomo_guid :docomo が指定されているコントローラ" do
|
36
|
-
|
54
|
+
before(:each) do
|
55
|
+
@controller = "docomo_guid_docomo"
|
56
|
+
@user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 ( .NET CLR 3.5.30729)"
|
57
|
+
end
|
58
|
+
|
37
59
|
it "の docomo_guid_mode は :docomo" do
|
60
|
+
get "/#{@controller}/link", {}, {"HTTP_USER_AGENT" => @user_agent}
|
61
|
+
|
38
62
|
controller.docomo_guid_mode.should == :docomo
|
39
63
|
end
|
40
64
|
end
|
41
65
|
|
42
66
|
def describe_mobile_with_ua(user_agent, &block)
|
43
|
-
describe("
|
44
|
-
controller_name :docomo_guid_docomo
|
67
|
+
describe("docomo_guid :docomo が指定されているコントローラに #{user_agent} からアクセスしたとき") do
|
45
68
|
before do
|
46
|
-
|
69
|
+
@controller = "docomo_guid_docomo"
|
70
|
+
@user_agent = user_agent
|
47
71
|
end
|
48
72
|
instance_eval(&block)
|
49
73
|
end
|
@@ -73,7 +97,6 @@ describe_mobile_with_ua "DoCoMo/1.0/N505i/c20/TB/W20H10 (compatible; Googlebot-M
|
|
73
97
|
it_should_behave_like "docomo_guid が起動しないとき"
|
74
98
|
end
|
75
99
|
|
76
|
-
|
77
100
|
describe_mobile_with_ua "DoCoMo/2.0/SO502i (compatible; Y!J-SRD/1.0; http://help.yahoo.co.jp/help/jp/search/indexing/indexing-27.html)" do
|
78
101
|
it_should_behave_like "docomo_guid が起動しないとき"
|
79
102
|
end
|