jpmobile 1.0.0.pre.4 → 1.0.0.pre.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +4 -0
- data/Gemfile +3 -3
- data/VERSION.yml +2 -2
- data/jpmobile.gemspec +335 -0
- data/lib/jpmobile.rb +0 -1
- data/lib/jpmobile/email.rb +47 -21
- data/lib/jpmobile/mail.rb +33 -26
- data/lib/jpmobile/mailer.rb +2 -0
- data/lib/jpmobile/util.rb +3 -3
- data/spec/unit/email-fixtures/au-attached.eml +1551 -0
- data/spec/unit/email-fixtures/au-decomail.eml +44 -0
- data/spec/unit/email-fixtures/au-emoji.eml +19 -0
- data/spec/unit/email-fixtures/au-emoji2.eml +45 -0
- data/spec/unit/email-fixtures/au-emoji5.eml +24 -0
- data/spec/unit/email-fixtures/docomo-emoji.eml +19 -0
- data/spec/unit/email-fixtures/docomo-gmail-sjis.eml +45 -0
- data/spec/unit/email-fixtures/docomo-jis.eml +20 -0
- data/spec/unit/email-fixtures/pc-mail-multi.eml +77 -0
- data/spec/unit/email-fixtures/pc-mail-single.eml +29 -0
- data/spec/unit/email-fixtures/softbank-blank.eml +20 -0
- data/spec/unit/email-fixtures/softbank-emoji-utf8.eml +19 -0
- data/spec/unit/email-fixtures/softbank-emoji.eml +19 -0
- data/spec/unit/email-fixtures/softbank-gmail-sjis.eml +45 -0
- data/spec/unit/email-fixtures/softbank-gmail-utf8.eml +45 -0
- data/spec/unit/{detect_by_email_spec.rb → email_spec.rb} +25 -2
- data/spec/unit/emoticon_spec.rb +1 -1
- data/spec/unit/encoding_spec.rb +1 -1
- data/spec/unit/is_carrier_spec.rb +1 -1
- data/spec/unit/mail_spec.rb +1 -1
- data/spec/unit/receive_mail_spec.rb +26 -1
- data/spec/unit/util_spec.rb +1 -1
- data/spec/unit/valid_ip_spec.rb +1 -1
- data/test/rails/.gitignore +1 -0
- data/test/rails/overrides/.rspec +5 -0
- data/test/rails/overrides/Gemfile +33 -0
- data/test/rails/overrides/app/views/filter/index.html.erb +0 -0
- data/test/rails/overrides/app/views/hankaku_filter/index.html.erb +0 -0
- data/test/rails/overrides/app/views/hankaku_input_filter/index.html.erb +0 -0
- data/test/rails/overrides/app/views/hankaku_input_filter/index_xhtml.html.erb +1 -0
- data/test/rails/overrides/app/views/layouts/xhtml.html.erb +12 -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/mobile_mailer/multi_message.html.erb +11 -0
- data/test/rails/overrides/app/views/mobile_mailer/multi_message.text.erb +2 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile_au.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile_docomo.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile_emobile.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile_softbank.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile_vodafone.html.erb +3 -0
- data/test/rails/overrides/app/views/mobile_mailer/view_selection_mobile_willcom.html.erb +3 -0
- data/test/rails/overrides/app/views/normal_mailer/msg.text.erb +3 -0
- data/test/rails/overrides/app/views/template_path/_partial.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/_partial_mobile.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/_partial_mobile_docomo.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.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/index_mobile.html.erb +1 -0
- data/test/rails/overrides/app/views/template_path/index_mobile_docomo.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/partial.html.erb +2 -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/spec/fixtures/mobile_mailer/au-attached.eml +1551 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/au-decomail.eml +44 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji.eml +19 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji2.eml +45 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji5.eml +24 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/docomo-emoji.eml +19 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/docomo-gmail-sjis.eml +45 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/docomo-jis.eml +20 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/no-from.eml +78 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/non-jp.eml +45 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/softbank-blank.eml +20 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/softbank-emoji-utf8.eml +19 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/softbank-emoji.eml +19 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/softbank-gmail-sjis.eml +45 -0
- data/test/rails/overrides/spec/fixtures/mobile_mailer/softbank-gmail-utf8.eml +45 -0
- data/test/rails/overrides/spec/helpers/helpers_spec.rb +1 -2
- data/test/rails/overrides/spec/models/mobile_mailer_spec.rb +37 -1
- data/test/rails/overrides/spec/models/normal_mailer_spec.rb +1 -1
- data/test/rails/overrides/spec/rcov.opts +2 -0
- data/test/rails/overrides/spec/requests/docomo_guid_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/docomo_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/emobile_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/filter_spec.rb +1 -1
- data/test/rails/overrides/spec/requests/helpers_spec.rb +1 -1
- data/test/rails/overrides/spec/requests/pc_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/softbank_emulator_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/template_path_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/trans_sid_spec.rb +1 -2
- data/test/rails/overrides/spec/spec_helper.rb +1 -1
- metadata +229 -386
- data/test/rails/rails_root/app/controllers/application_controller.rb +0 -6
- data/test/rails/rails_root/app/controllers/docomo_guid_always_controller.rb +0 -3
- data/test/rails/rails_root/app/controllers/docomo_guid_base_controller.rb +0 -5
- data/test/rails/rails_root/app/controllers/docomo_guid_docomo_controller.rb +0 -3
- data/test/rails/rails_root/app/controllers/filter_controller.rb +0 -3
- data/test/rails/rails_root/app/controllers/filter_controller_base.rb +0 -25
- data/test/rails/rails_root/app/controllers/hankaku_filter_controller.rb +0 -3
- data/test/rails/rails_root/app/controllers/hankaku_input_filter_controller.rb +0 -7
- data/test/rails/rails_root/app/controllers/links_controller.rb +0 -28
- data/test/rails/rails_root/app/controllers/mobile_spec_controller.rb +0 -5
- data/test/rails/rails_root/app/controllers/template_path_controller.rb +0 -17
- data/test/rails/rails_root/app/controllers/trans_sid_always_and_session_off_controller.rb +0 -4
- data/test/rails/rails_root/app/controllers/trans_sid_always_controller.rb +0 -3
- data/test/rails/rails_root/app/controllers/trans_sid_base_controller.rb +0 -40
- data/test/rails/rails_root/app/controllers/trans_sid_metal_controller.rb +0 -15
- data/test/rails/rails_root/app/controllers/trans_sid_mobile_controller.rb +0 -3
- data/test/rails/rails_root/app/controllers/trans_sid_none_controller.rb +0 -3
- data/test/rails/rails_root/app/helpers/application_helper.rb +0 -2
- data/test/rails/rails_root/app/models/mobile_mailer.rb +0 -19
- data/test/rails/rails_root/app/models/normal_mailer.rb +0 -9
- data/test/rails/rails_root/app/models/user.rb +0 -2
- data/test/rails/rails_root/autotest/discover.rb +0 -2
- data/test/rails/rails_root/config/application.rb +0 -42
- data/test/rails/rails_root/config/boot.rb +0 -6
- data/test/rails/rails_root/config/environment.rb +0 -5
- data/test/rails/rails_root/config/environments/development.rb +0 -26
- data/test/rails/rails_root/config/environments/production.rb +0 -49
- data/test/rails/rails_root/config/environments/test.rb +0 -35
- data/test/rails/rails_root/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails/rails_root/config/initializers/inflections.rb +0 -10
- data/test/rails/rails_root/config/initializers/jpmobile_generator.rb +0 -2
- data/test/rails/rails_root/config/initializers/mime_types.rb +0 -5
- data/test/rails/rails_root/config/initializers/secret_token.rb +0 -7
- data/test/rails/rails_root/config/initializers/session_store.rb +0 -2
- data/test/rails/rails_root/config/routes.rb +0 -7
- data/test/rails/rails_root/db/migrate/001_add_sessions_table.rb +0 -16
- data/test/rails/rails_root/db/migrate/20100824062306_create_users.rb +0 -13
- data/test/rails/rails_root/db/schema.rb +0 -31
- data/test/rails/rails_root/db/seeds.rb +0 -7
- data/test/rails/rails_root/spec/helpers/helpers_spec.rb +0 -15
- data/test/rails/rails_root/spec/models/mobile_mailer_spec.rb +0 -737
- data/test/rails/rails_root/spec/models/normal_mailer_spec.rb +0 -34
- data/test/rails/rails_root/spec/requests/docomo_guid_spec.rb +0 -102
- data/test/rails/rails_root/spec/requests/docomo_spec.rb +0 -33
- data/test/rails/rails_root/spec/requests/emobile_spec.rb +0 -53
- data/test/rails/rails_root/spec/requests/filter_spec.rb +0 -221
- data/test/rails/rails_root/spec/requests/helpers_spec.rb +0 -187
- data/test/rails/rails_root/spec/requests/pc_spec.rb +0 -22
- data/test/rails/rails_root/spec/requests/softbank_emulator_spec.rb +0 -21
- data/test/rails/rails_root/spec/requests/template_path_spec.rb +0 -240
- data/test/rails/rails_root/spec/requests/trans_sid_spec.rb +0 -207
- data/test/rails/rails_root/spec/spec_helper.rb +0 -38
- data/test/rails/rails_root/test/performance/browsing_test.rb +0 -9
- data/test/rails/rails_root/test/test_helper.rb +0 -13
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile-ipaddresses.rb +0 -18
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/abstract_ip_addresses.rb +0 -23
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/au.rb +0 -40
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/docomo.rb +0 -22
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/emobile.rb +0 -15
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/softbank.rb +0 -20
- data/test/rails/rails_root/vendor/plugins/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/willcom.rb +0 -158
- data/test/rails/rails_root/vendor/plugins/jpmobile-terminfo/lib/jpmobile-terminfo.rb +0 -9
- data/test/rails/rails_root/vendor/plugins/jpmobile-terminfo/lib/jpmobile/mobile/terminfo.rb +0 -62
- data/test/rails/rails_root/vendor/plugins/jpmobile-terminfo/lib/jpmobile/mobile/terminfo/docomo.rb +0 -739
- data/test/rails/rails_root/vendor/plugins/jpmobile-terminfo/spec/spec_helper.rb +0 -2
- data/test/rails/rails_root/vendor/plugins/jpmobile-terminfo/spec/terminfo_spec.rb +0 -54
- data/test/rails/rails_root/vendor/plugins/jpmobile/init.rb +0 -3
- data/test/rails/rails_root/vendor/plugins/jpmobile/install.rb +0 -1
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile.rb +0 -59
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/datum_conv.rb +0 -72
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/docomo_guid.rb +0 -43
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/email.rb +0 -33
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon.rb +0 -205
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/au.rb +0 -1931
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/conversion_table.rb +0 -3909
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/docomo.rb +0 -255
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/softbank.rb +0 -965
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/emoticon/z_combine.rb +0 -36
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/encoding.rb +0 -29
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/filter.rb +0 -113
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/helpers.rb +0 -174
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_controller.rb +0 -18
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_dispatch.rb +0 -2
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/hook_action_view.rb +0 -33
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/lookup_context.rb +0 -2
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mail.rb +0 -330
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mailer.rb +0 -41
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/abstract_mobile.rb +0 -168
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/android.rb +0 -10
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/au.rb +0 -128
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/ddipocket.rb +0 -12
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/docomo.rb +0 -149
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/emobile.rb +0 -16
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/iphone.rb +0 -26
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/smart_phone.rb +0 -21
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/softbank.rb +0 -91
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/vodafone.rb +0 -17
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/willcom.rb +0 -28
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/mobile/windows_phone.rb +0 -10
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/path_set.rb +0 -40
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/position.rb +0 -68
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack.rb +0 -49
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/filter.rb +0 -50
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/mobile_carrier.rb +0 -33
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rack/params_filter.rb +0 -47
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/rails.rb +0 -50
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/request_with_mobile.rb +0 -45
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/resolver.rb +0 -38
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/trans_sid.rb +0 -133
- data/test/rails/rails_root/vendor/plugins/jpmobile/lib/jpmobile/util.rb +0 -370
- data/test/rails/rails_root/vendor/plugins/jpmobile/tmp/conversion-table.rb +0 -2588
- data/test/rails/rails_root/vendor/plugins/jpmobile/tmp/utf8_to_image.rb +0 -1407
- data/test/rails/rails_root/vendor/plugins/jpmobile/tools/emoji/genregexp.rb +0 -47
- data/test/rails/rails_root/vendor/plugins/jpmobile/tools/generate_au_emoticon_table.rb +0 -34
- data/test/rails/rails_root/vendor/plugins/jpmobile/tools/generate_docomo_emoticon_table.rb +0 -33
- data/test/rails/rails_root/vendor/plugins/jpmobile/tools/generate_emoticon_conversion_table.rb +0 -107
- data/test/rails/rails_root/vendor/plugins/jpmobile/tools/generate_softbank_emoticon_table.rb +0 -31
- data/test/rails/rails_root/vendor/plugins/jpmobile/tools/list_gps_unsupported_au.rb +0 -23
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile-ipaddresses.rb +0 -18
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/abstract_ip_addresses.rb +0 -23
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/au.rb +0 -40
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/docomo.rb +0 -22
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/emobile.rb +0 -15
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/softbank.rb +0 -20
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-ipaddresses/lib/jpmobile/mobile/ip_addresses/willcom.rb +0 -158
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-terminfo/lib/jpmobile-terminfo.rb +0 -9
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-terminfo/lib/jpmobile/mobile/terminfo.rb +0 -62
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-terminfo/lib/jpmobile/mobile/terminfo/docomo.rb +0 -739
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-terminfo/spec/spec_helper.rb +0 -2
- data/test/rails/rails_root/vendor/plugins/jpmobile/vendor/jpmobile-terminfo/spec/terminfo_spec.rb +0 -54
@@ -1,7 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
# Make sure the secret is at least 30 characters and all random,
|
6
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
RailsRoot::Application.config.secret_token = '6773d9dbfee1e199c5f7f1cb8c7fff442792f70e3051397a9535b04258bafb009a0a566b0fe0d10a67d64aefaf7396b675ea386893c634411df09272f1f978d4'
|
@@ -1,16 +0,0 @@
|
|
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
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# This file is auto-generated from the current state of the database. Instead
|
2
|
-
# of editing this file, please use the migrations feature of Active Record to
|
3
|
-
# incrementally modify your database, and then regenerate this schema definition.
|
4
|
-
#
|
5
|
-
# Note that this schema.rb definition is the authoritative source for your
|
6
|
-
# database schema. If you need to create the application database on another
|
7
|
-
# system, you should be using db:schema:load, not running all the migrations
|
8
|
-
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
9
|
-
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
10
|
-
#
|
11
|
-
# It's strongly recommended to check this file into your version control system.
|
12
|
-
|
13
|
-
ActiveRecord::Schema.define(:version => 20100824062306) do
|
14
|
-
|
15
|
-
create_table "sessions", :force => true do |t|
|
16
|
-
t.string "session_id", :null => false
|
17
|
-
t.text "data"
|
18
|
-
t.datetime "created_at"
|
19
|
-
t.datetime "updated_at"
|
20
|
-
end
|
21
|
-
|
22
|
-
add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
|
23
|
-
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
|
24
|
-
|
25
|
-
create_table "users", :force => true do |t|
|
26
|
-
t.string "name"
|
27
|
-
t.datetime "created_at"
|
28
|
-
t.datetime "updated_at"
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
@@ -1,7 +0,0 @@
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
3
|
-
#
|
4
|
-
# Examples:
|
5
|
-
#
|
6
|
-
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
7
|
-
# Mayor.create(:name => 'Daley', :city => cities.first)
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
4
|
-
|
5
|
-
describe Jpmobile::Helpers do
|
6
|
-
include Jpmobile::Helpers
|
7
|
-
it "docomo_guid_link_to が guid=ON を付けたリンクを生成すること" do
|
8
|
-
docomo_guid_link_to("STRING", :controller => "filter", :action => "rawdata").should == %{<a href="/filter/rawdata?guid=ON">STRING</a>}
|
9
|
-
end
|
10
|
-
|
11
|
-
it "softbank_location_link_to がリンク先にパラメータを含んでいても正常に動作すること" do
|
12
|
-
# http://d.hatena.ne.jp/mizincogrammer/20090123/1232702067
|
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
|
-
end
|
15
|
-
end
|
@@ -1,737 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
3
|
-
|
4
|
-
describe MobileMailer do
|
5
|
-
include Jpmobile::Util
|
6
|
-
|
7
|
-
before(:each) do
|
8
|
-
ActionMailer::Base.deliveries = []
|
9
|
-
|
10
|
-
@to = ["outer@jp.mobile", "outer1@jp.mobile"]
|
11
|
-
@subject = "日本語題名"
|
12
|
-
@text = "日本語テキスト"
|
13
|
-
@sjis_regexp = %r!=\?shift_jis\?B\?(.+)\?=!
|
14
|
-
@jis_regexp = %r!=\?iso-2022-jp\?B\?(.+)\?=!
|
15
|
-
end
|
16
|
-
|
17
|
-
shared_examples_for "PC宛メール" do
|
18
|
-
it "正常に送信できること" do
|
19
|
-
email = MobileMailer.view_selection(@to, "題名", "本文").deliver
|
20
|
-
|
21
|
-
ActionMailer::Base.deliveries.size.should == 1
|
22
|
-
email.to.include?(@to).should be_true
|
23
|
-
end
|
24
|
-
|
25
|
-
it "ISO-2022-JPに変換されること" do
|
26
|
-
email = MobileMailer.view_selection(@to, "題名", "本文").deliver
|
27
|
-
|
28
|
-
ActionMailer::Base.deliveries.size.should == 1
|
29
|
-
|
30
|
-
raw_mail = ascii_8bit(email.to_s)
|
31
|
-
raw_mail.should match(/iso-2022-jp/i)
|
32
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit([utf8_to_jis("題名")].pack('m').strip))))
|
33
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit(utf8_to_jis("本文")))))
|
34
|
-
end
|
35
|
-
|
36
|
-
it "絵文字がゲタ(〓)に変換されること" do
|
37
|
-
email = MobileMailer.view_selection(@to, "題名", "本文".html_safe).deliver
|
38
|
-
|
39
|
-
ActionMailer::Base.deliveries.size.should == 1
|
40
|
-
|
41
|
-
raw_mail = ascii_8bit(email.to_s)
|
42
|
-
raw_mail.should match(Regexp.escape("GyRCQmpMPiIuGyhC"))
|
43
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit(utf8_to_jis("本文〓")))))
|
44
|
-
end
|
45
|
-
|
46
|
-
it "quoted-printableではないときに勝手に変換されないこと" do
|
47
|
-
email = MobileMailer.view_selection(@to, "題名",
|
48
|
-
"本文です\nhttp://test.rails/foo/bar/index?d=430d0d1cea109cdb384ec5554b890e3940f293c7&e=ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L").deliver
|
49
|
-
|
50
|
-
ActionMailer::Base.deliveries.size.should == 1
|
51
|
-
|
52
|
-
raw_mail = ascii_8bit(email.to_s)
|
53
|
-
raw_mail.should match(/ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L/)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
describe "PC宛に送るとき" do
|
58
|
-
before(:each) do
|
59
|
-
@to = "bill.gate@microsoft.com"
|
60
|
-
end
|
61
|
-
|
62
|
-
it_behaves_like "PC宛メール"
|
63
|
-
|
64
|
-
it "複数に配信するときもISO-2022-JPに変換されること" do
|
65
|
-
email = MobileMailer.view_selection(@to, "題名", "本文").deliver
|
66
|
-
|
67
|
-
ActionMailer::Base.deliveries.size.should == 1
|
68
|
-
|
69
|
-
raw_mail = ascii_8bit(email.to_s)
|
70
|
-
raw_mail.should match(/iso-2022-jp/i)
|
71
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit([utf8_to_jis("題名")].pack('m').strip))))
|
72
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit(utf8_to_jis("本文")))))
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
describe "docomo にメールを送るとき" do
|
77
|
-
before(:each) do
|
78
|
-
@to = "docomo@docomo.ne.jp"
|
79
|
-
end
|
80
|
-
|
81
|
-
it "subject/body が Shift-JIS になること" do
|
82
|
-
email = MobileMailer.view_selection(@to, @subject, @text).deliver
|
83
|
-
|
84
|
-
ActionMailer::Base.deliveries.size.should == 1
|
85
|
-
|
86
|
-
raw_mail = email.to_s
|
87
|
-
raw_mail.should match(/shift_jis/i)
|
88
|
-
# raw_mail.should match(/For docomo/)
|
89
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvA=="))
|
90
|
-
raw_mail.should match(Regexp.compile(utf8_to_sjis(@text)))
|
91
|
-
end
|
92
|
-
|
93
|
-
it "数値参照の絵文字が変換されること" do
|
94
|
-
emoji_subject = @subject + ""
|
95
|
-
emoji_text = @text + ""
|
96
|
-
|
97
|
-
email = MobileMailer.view_selection(@to, emoji_subject, emoji_text.html_safe).deliver
|
98
|
-
|
99
|
-
ActionMailer::Base.deliveries.size.should == 1
|
100
|
-
|
101
|
-
raw_mail = email.to_s
|
102
|
-
raw_mail.should match(/For docomo/)
|
103
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvPjX"))
|
104
|
-
raw_mail.should match(regexp_to_sjis("\xf8\xec"))
|
105
|
-
end
|
106
|
-
|
107
|
-
it "半角カナがそのまま送信されること" do
|
108
|
-
half_kana_subject = @subject + "ゲーム"
|
109
|
-
half_kana_text = @text + "ブック"
|
110
|
-
|
111
|
-
email = MobileMailer.view_selection(@to, half_kana_subject, half_kana_text).deliver
|
112
|
-
|
113
|
-
ActionMailer::Base.deliveries.size.should == 1
|
114
|
-
|
115
|
-
raw_mail = email.to_s
|
116
|
-
raw_mail.should match(/For docomo/)
|
117
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvLnesNE="))
|
118
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(utf8_to_sjis(half_kana_text))))
|
119
|
-
end
|
120
|
-
|
121
|
-
it "quoted-printable ではないときに勝手に変換されないこと" do
|
122
|
-
email = MobileMailer.view_selection(@to, "題名",
|
123
|
-
"本文です\nhttp://test.rails/foo/bar/index?d=430d0d1cea109cdb384ec5554b890e3940f293c7&e=ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L").deliver
|
124
|
-
|
125
|
-
ActionMailer::Base.deliveries.size.should == 1
|
126
|
-
|
127
|
-
raw_mail = email.to_s
|
128
|
-
raw_mail.should match(/ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L/)
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
describe "au にメールを送るとき" do
|
133
|
-
before(:each) do
|
134
|
-
@to = "au@ezweb.ne.jp"
|
135
|
-
end
|
136
|
-
|
137
|
-
it "subject/body がISO-2022-JPになること" do
|
138
|
-
email = MobileMailer.view_selection(@to, @subject, @text).deliver
|
139
|
-
|
140
|
-
ActionMailer::Base.deliveries.size.should == 1
|
141
|
-
|
142
|
-
raw_mail = ascii_8bit(email.to_s)
|
143
|
-
raw_mail.should match(/iso-2022-jp/i)
|
144
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit([utf8_to_jis(@subject)].pack('m').strip))))
|
145
|
-
raw_mail.should match(Regexp.compile(Regexp.escape(ascii_8bit(utf8_to_jis(@text)))))
|
146
|
-
end
|
147
|
-
|
148
|
-
it "数値参照が絵文字に変換されること" do
|
149
|
-
emoji_subject = @subject + ""
|
150
|
-
emoji_text = @text + ""
|
151
|
-
|
152
|
-
email = MobileMailer.view_selection(@to, emoji_subject, emoji_text.html_safe).deliver
|
153
|
-
|
154
|
-
ActionMailer::Base.deliveries.size.should == 1
|
155
|
-
|
156
|
-
raw_mail = ascii_8bit(email.to_s)
|
157
|
-
raw_mail.should match(/For au/)
|
158
|
-
raw_mail.should match(Regexp.escape("GyRCRnxLXDhsQmpMPhsoQhskQnZeGyhC"))
|
159
|
-
raw_mail.should match(Regexp.compile(ascii_8bit("\x76\x21")))
|
160
|
-
end
|
161
|
-
|
162
|
-
it "quoted-printable ではないときに勝手に変換されないこと" do
|
163
|
-
email = MobileMailer.view_selection(@to, "題名",
|
164
|
-
"本文です\nhttp://test.rails/foo/bar/index?d=430d0d1cea109cdb384ec5554b890e3940f293c7&e=ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L").deliver
|
165
|
-
|
166
|
-
ActionMailer::Base.deliveries.size.should == 1
|
167
|
-
|
168
|
-
raw_mail = ascii_8bit(email.to_s)
|
169
|
-
raw_mail.should match(/ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L/)
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
describe "softbank にメールを送るとき" do
|
174
|
-
before(:each) do
|
175
|
-
@to = "softbank@softbank.ne.jp"
|
176
|
-
end
|
177
|
-
|
178
|
-
it "subject/body が Shift_JIS になること" do
|
179
|
-
email = MobileMailer.view_selection(@to, @subject, @text).deliver
|
180
|
-
|
181
|
-
ActionMailer::Base.deliveries.size.should == 1
|
182
|
-
|
183
|
-
raw_mail = email.to_s
|
184
|
-
raw_mail.should match(/shift_jis/i)
|
185
|
-
raw_mail.should match(/For softbank/)
|
186
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvA=="))
|
187
|
-
raw_mail.should match(Regexp.compile(utf8_to_sjis(@text)))
|
188
|
-
end
|
189
|
-
|
190
|
-
it "数値参照が絵文字に変換されること" do
|
191
|
-
emoji_subject = @subject + ""
|
192
|
-
emoji_text = @text + ""
|
193
|
-
|
194
|
-
email = MobileMailer.view_selection(@to, emoji_subject, emoji_text.html_safe).deliver
|
195
|
-
|
196
|
-
ActionMailer::Base.deliveries.size.should == 1
|
197
|
-
|
198
|
-
raw_mail = email.to_s
|
199
|
-
raw_mail.should match(/For softbank/)
|
200
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvPl8"))
|
201
|
-
raw_mail.should match(regexp_to_sjis("\xf7\x6a"))
|
202
|
-
end
|
203
|
-
|
204
|
-
it "quoted-printable ではないときに勝手に変換されないこと" do
|
205
|
-
email = MobileMailer.view_selection(@to, "題名",
|
206
|
-
"本文です\nhttp://test.rails/foo/bar/index?d=430d0d1cea109cdb384ec5554b890e3940f293c7&e=ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L").deliver
|
207
|
-
|
208
|
-
ActionMailer::Base.deliveries.size.should == 1
|
209
|
-
|
210
|
-
raw_mail = email.to_s
|
211
|
-
raw_mail.should match(/ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L/)
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
describe "vodafone にメールを送るとき" do
|
216
|
-
before(:each) do
|
217
|
-
@to = "vodafone@d.vodafone.ne.jp"
|
218
|
-
end
|
219
|
-
|
220
|
-
it "subject/body が Shift_JIS になること" do
|
221
|
-
email = MobileMailer.view_selection(@to, @subject, @text).deliver
|
222
|
-
|
223
|
-
ActionMailer::Base.deliveries.size.should == 1
|
224
|
-
|
225
|
-
raw_mail = email.to_s
|
226
|
-
raw_mail.should match(/shift_jis/i)
|
227
|
-
raw_mail.should match(/For vodafone/)
|
228
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvA=="))
|
229
|
-
raw_mail.should match(Regexp.compile(utf8_to_sjis(@text)))
|
230
|
-
end
|
231
|
-
|
232
|
-
it "数値参照が絵文字に変換されること" do
|
233
|
-
emoji_subject = @subject + ""
|
234
|
-
emoji_text = @text + ""
|
235
|
-
|
236
|
-
email = MobileMailer.view_selection(@to, emoji_subject, emoji_text.html_safe).deliver
|
237
|
-
|
238
|
-
ActionMailer::Base.deliveries.size.should == 1
|
239
|
-
|
240
|
-
raw_mail = email.to_s
|
241
|
-
raw_mail.should match(/For vodafone/)
|
242
|
-
raw_mail.should match(Regexp.escape("k/qWe4zqkeiWvPl8"))
|
243
|
-
raw_mail.should match(regexp_to_sjis("\xf7\x6a"))
|
244
|
-
end
|
245
|
-
|
246
|
-
it "quoted-printable ではないときに勝手に変換されないこと" do
|
247
|
-
email = MobileMailer.view_selection(@to, "題名",
|
248
|
-
"本文です\nhttp://test.rails/foo/bar/index?d=430d0d1cea109cdb384ec5554b890e3940f293c7&e=ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L").deliver
|
249
|
-
|
250
|
-
ActionMailer::Base.deliveries.size.should == 1
|
251
|
-
|
252
|
-
raw_mail = email.to_s
|
253
|
-
raw_mail.should match(/ZVG%0FE%16%5E%07%04%21P%5CZ%06%00%0D%1D%40L/)
|
254
|
-
end
|
255
|
-
end
|
256
|
-
|
257
|
-
describe "willcom にメールを送るとき" do
|
258
|
-
before(:each) do
|
259
|
-
@to = "willcom@wm.pdx.ne.jp"
|
260
|
-
end
|
261
|
-
|
262
|
-
it_behaves_like "PC宛メール"
|
263
|
-
end
|
264
|
-
|
265
|
-
describe "emobile にメールを送るとき" do
|
266
|
-
before(:each) do
|
267
|
-
@to = "emobile@emnet.ne.jp"
|
268
|
-
end
|
269
|
-
|
270
|
-
it_behaves_like "PC宛メール"
|
271
|
-
end
|
272
|
-
|
273
|
-
describe "multipart メールを送信するとき" do
|
274
|
-
before(:each) do
|
275
|
-
ActionMailer::Base.deliveries = []
|
276
|
-
|
277
|
-
@subject = "題名"
|
278
|
-
@text = "本文"
|
279
|
-
@html = "万葉"
|
280
|
-
end
|
281
|
-
|
282
|
-
describe "PC の場合" do
|
283
|
-
before(:each) do
|
284
|
-
@to = "gate@bill.com"
|
285
|
-
end
|
286
|
-
|
287
|
-
it "漢字コードが変換されること" do
|
288
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
289
|
-
|
290
|
-
ActionMailer::Base.deliveries.size.should == 1
|
291
|
-
|
292
|
-
email.parts.size.should == 2
|
293
|
-
|
294
|
-
raw_mail = ascii_8bit(email.to_s)
|
295
|
-
raw_mail.should match(Regexp.escape(ascii_8bit(utf8_to_jis(@text))))
|
296
|
-
raw_mail.should match(Regexp.escape(ascii_8bit(utf8_to_jis(@html))))
|
297
|
-
end
|
298
|
-
end
|
299
|
-
|
300
|
-
describe "docomo の場合" do
|
301
|
-
before(:each) do
|
302
|
-
@to = "docomo@docomo.ne.jp"
|
303
|
-
end
|
304
|
-
|
305
|
-
it "漢字コードが変換されること" do
|
306
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
307
|
-
|
308
|
-
ActionMailer::Base.deliveries.size.should == 1
|
309
|
-
|
310
|
-
email.parts.size.should == 2
|
311
|
-
|
312
|
-
raw_mail = email.to_s
|
313
|
-
raw_mail.should match(sjis_regexp(utf8_to_sjis(@text)))
|
314
|
-
raw_mail.should match(sjis_regexp(utf8_to_sjis(@html)))
|
315
|
-
end
|
316
|
-
|
317
|
-
it "絵文字が変換されること" do
|
318
|
-
@text += ""
|
319
|
-
@html += ""
|
320
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
321
|
-
|
322
|
-
ActionMailer::Base.deliveries.size.should == 1
|
323
|
-
|
324
|
-
email.parts.size.should == 2
|
325
|
-
|
326
|
-
raw_mail = email.to_s
|
327
|
-
raw_mail.should match(sjis_regexp(sjis("\xf8\xec")))
|
328
|
-
raw_mail.should match(sjis_regexp(sjis("\xf8\xd7")))
|
329
|
-
end
|
330
|
-
end
|
331
|
-
|
332
|
-
describe "au の場合" do
|
333
|
-
before(:each) do
|
334
|
-
@to = "au@ezweb.ne.jp"
|
335
|
-
end
|
336
|
-
|
337
|
-
it "漢字コードが変換されること" do
|
338
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
339
|
-
|
340
|
-
ActionMailer::Base.deliveries.size.should == 1
|
341
|
-
|
342
|
-
email.parts.size.should == 2
|
343
|
-
|
344
|
-
raw_mail = ascii_8bit(email.to_s)
|
345
|
-
raw_mail.should match(Regexp.escape(ascii_8bit(utf8_to_jis(@text))))
|
346
|
-
raw_mail.should match(Regexp.escape(ascii_8bit(utf8_to_jis(@html))))
|
347
|
-
end
|
348
|
-
|
349
|
-
it "絵文字が変換されること" do
|
350
|
-
@text += ""
|
351
|
-
@html += ""
|
352
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
353
|
-
|
354
|
-
ActionMailer::Base.deliveries.size.should == 1
|
355
|
-
|
356
|
-
email.parts.size.should == 2
|
357
|
-
|
358
|
-
raw_mail = ascii_8bit(email.to_s)
|
359
|
-
raw_mail.should match(jis_regexp("\x76\x21"))
|
360
|
-
raw_mail.should match(jis_regexp("\x76\x5e"))
|
361
|
-
end
|
362
|
-
end
|
363
|
-
|
364
|
-
describe "softbank の場合" do
|
365
|
-
before(:each) do
|
366
|
-
@to = "softbank@softbank.ne.jp"
|
367
|
-
end
|
368
|
-
|
369
|
-
it "漢字コードが変換されること" do
|
370
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
371
|
-
|
372
|
-
ActionMailer::Base.deliveries.size.should == 1
|
373
|
-
|
374
|
-
email.parts.size.should == 2
|
375
|
-
|
376
|
-
raw_mail = email.to_s
|
377
|
-
raw_mail.should match(sjis_regexp(utf8_to_sjis(@text)))
|
378
|
-
raw_mail.should match(sjis_regexp(utf8_to_sjis(@html)))
|
379
|
-
end
|
380
|
-
|
381
|
-
it "絵文字が変換されること" do
|
382
|
-
@text += ""
|
383
|
-
@html += ""
|
384
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
385
|
-
|
386
|
-
ActionMailer::Base.deliveries.size.should == 1
|
387
|
-
|
388
|
-
email.parts.size.should == 2
|
389
|
-
|
390
|
-
raw_mail = email.to_s
|
391
|
-
raw_mail.should match(sjis_regexp(sjis("\xf7\x6a")))
|
392
|
-
raw_mail.should match(sjis_regexp(sjis("\xf9\x7c")))
|
393
|
-
end
|
394
|
-
end
|
395
|
-
|
396
|
-
describe "vodafone の場合" do
|
397
|
-
before(:each) do
|
398
|
-
@to = "vodafone@d.vodafone.ne.jp"
|
399
|
-
end
|
400
|
-
|
401
|
-
it "漢字コードが変換されること" do
|
402
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
403
|
-
|
404
|
-
ActionMailer::Base.deliveries.size.should == 1
|
405
|
-
|
406
|
-
email.parts.size.should == 2
|
407
|
-
|
408
|
-
raw_mail = email.to_s
|
409
|
-
raw_mail.should match(sjis_regexp(utf8_to_sjis(@text)))
|
410
|
-
raw_mail.should match(sjis_regexp(utf8_to_sjis(@html)))
|
411
|
-
end
|
412
|
-
|
413
|
-
it "絵文字が変換されること" do
|
414
|
-
@text += ""
|
415
|
-
@html += ""
|
416
|
-
email = MobileMailer.multi_message(@to, @subject, @text, @html).deliver
|
417
|
-
|
418
|
-
ActionMailer::Base.deliveries.size.should == 1
|
419
|
-
|
420
|
-
email.parts.size.should == 2
|
421
|
-
|
422
|
-
raw_mail = email.to_s
|
423
|
-
raw_mail.should match(sjis_regexp(sjis("\xf7\x6a")))
|
424
|
-
raw_mail.should match(sjis_regexp(sjis("\xf9\x7c")))
|
425
|
-
end
|
426
|
-
end
|
427
|
-
end
|
428
|
-
end
|
429
|
-
|
430
|
-
describe MobileMailer, " mail address" do
|
431
|
-
before(:each) do
|
432
|
-
ActionMailer::Base.deliveries = []
|
433
|
-
|
434
|
-
@subject = "日本語題名"
|
435
|
-
@text = "日本語テキスト"
|
436
|
-
end
|
437
|
-
|
438
|
-
it "ピリオドが3つ以上連続するアドレスが有効になること" do
|
439
|
-
to = "ruby...rails@domomo-ezweb.ne.jp"
|
440
|
-
MobileMailer.view_selection(to, @subject, @text).deliver
|
441
|
-
|
442
|
-
emails = ActionMailer::Base.deliveries
|
443
|
-
emails.size.should == 1
|
444
|
-
emails.first.to.include?(to).should be_true
|
445
|
-
emails.first.destinations.include?(to).should be_true
|
446
|
-
end
|
447
|
-
|
448
|
-
it "@マークの直前にピリオドあるアドレスが有効になること" do
|
449
|
-
to = "ruby.rails.@domomo-ezweb.ne.jp"
|
450
|
-
MobileMailer.view_selection(to, @subject, @text).deliver
|
451
|
-
|
452
|
-
emails = ActionMailer::Base.deliveries
|
453
|
-
emails.size.should == 1
|
454
|
-
emails.first.to.include?(to).should be_true
|
455
|
-
emails.first.destinations.include?(to).should be_true
|
456
|
-
end
|
457
|
-
|
458
|
-
it "ピリオドから始まるアドレスが有効になること" do
|
459
|
-
to = ".ruby.rails.@domomo-ezweb.ne.jp"
|
460
|
-
MobileMailer.view_selection(to, @subject, @text).deliver
|
461
|
-
|
462
|
-
emails = ActionMailer::Base.deliveries
|
463
|
-
emails.size.should == 1
|
464
|
-
emails.first.to.include?(to).should be_true
|
465
|
-
emails.first.destinations.include?(to).should be_true
|
466
|
-
end
|
467
|
-
|
468
|
-
it "複数のアドレスが有効になること" do
|
469
|
-
to = [".ruby.rails.@domomo-ezweb.ne.jp", "ruby.rails.@domomo-ezweb.ne.jp", "ruby...rails@domomo-ezweb.ne.jp"].join(", ")
|
470
|
-
MobileMailer.view_selection(to, @subject, @text).deliver
|
471
|
-
|
472
|
-
emails = ActionMailer::Base.deliveries
|
473
|
-
emails.size.should == 1
|
474
|
-
emails.first.to.should == to
|
475
|
-
emails.first.destinations.should == [to]
|
476
|
-
end
|
477
|
-
end
|
478
|
-
|
479
|
-
describe MobileMailer, "receiving" do
|
480
|
-
describe "blank mail" do
|
481
|
-
it "softbank からの空メールがで受信できること" do
|
482
|
-
email = open(Rails.root + "spec/fixtures/mobile_mailer/softbank-blank.eml").read
|
483
|
-
# expect {
|
484
|
-
email = MobileMailer.receive(email)
|
485
|
-
# }.to_not raise_error
|
486
|
-
|
487
|
-
email.subject.should be_blank
|
488
|
-
email.body.should be_blank
|
489
|
-
end
|
490
|
-
end
|
491
|
-
|
492
|
-
describe "docomo からのメールを受信するとき" do
|
493
|
-
before(:each) do
|
494
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/docomo-emoji.eml").read
|
495
|
-
end
|
496
|
-
|
497
|
-
it "漢字コードを適切に変換できること" do
|
498
|
-
email = MobileMailer.receive(@email)
|
499
|
-
email.subject.should match(/題名/)
|
500
|
-
email.body.should match(/本文/)
|
501
|
-
end
|
502
|
-
|
503
|
-
it "絵文字が数値参照に変わること" do
|
504
|
-
email = MobileMailer.receive(@email)
|
505
|
-
|
506
|
-
email.subject.should match(//)
|
507
|
-
email.body.should match(//)
|
508
|
-
end
|
509
|
-
|
510
|
-
describe "jis コードの場合に" do
|
511
|
-
before(:each) do
|
512
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/docomo-jis.eml").read
|
513
|
-
end
|
514
|
-
|
515
|
-
it "適切に変換できること" do
|
516
|
-
email = MobileMailer.receive(@email)
|
517
|
-
|
518
|
-
email.subject.should match(/テスト/)
|
519
|
-
email.body.should match(/テスト本文/)
|
520
|
-
end
|
521
|
-
end
|
522
|
-
end
|
523
|
-
|
524
|
-
describe "au からのメールを受信するとき" do
|
525
|
-
describe "jpmobile で送信したメールの場合" do
|
526
|
-
before(:each) do
|
527
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/au-emoji.eml").read
|
528
|
-
end
|
529
|
-
|
530
|
-
it "漢字コードを適切に変換できること" do
|
531
|
-
email = MobileMailer.receive(@email)
|
532
|
-
|
533
|
-
email.subject.should match(/題名/)
|
534
|
-
email.body.should match(/本文/)
|
535
|
-
end
|
536
|
-
|
537
|
-
it "絵文字が数値参照に変わること" do
|
538
|
-
email = MobileMailer.receive(@email)
|
539
|
-
|
540
|
-
email.subject.should match(//)
|
541
|
-
email.body.should match(//)
|
542
|
-
end
|
543
|
-
end
|
544
|
-
|
545
|
-
describe "実機からのメールの場合" do
|
546
|
-
before(:each) do
|
547
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/au-emoji2.eml").read
|
548
|
-
end
|
549
|
-
|
550
|
-
it "漢字コードを適切に変換できること" do
|
551
|
-
email = MobileMailer.receive(@email)
|
552
|
-
|
553
|
-
email.subject.should match(/題名/)
|
554
|
-
email.body.should match(/本文/)
|
555
|
-
end
|
556
|
-
|
557
|
-
it "絵文字が数値参照に変わること" do
|
558
|
-
email = MobileMailer.receive(@email)
|
559
|
-
|
560
|
-
email.subject.should match(//)
|
561
|
-
email.body.should match(//)
|
562
|
-
end
|
563
|
-
end
|
564
|
-
end
|
565
|
-
|
566
|
-
describe "softbank からのメールを受信するとき" do
|
567
|
-
describe "shift_jis のとき" do
|
568
|
-
before(:each) do
|
569
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/softbank-emoji.eml").read
|
570
|
-
end
|
571
|
-
|
572
|
-
it "漢字コードを適切に変換できること" do
|
573
|
-
email = MobileMailer.receive(@email)
|
574
|
-
|
575
|
-
email.subject.should match(/題名/)
|
576
|
-
email.body.should match(/本文/)
|
577
|
-
end
|
578
|
-
|
579
|
-
it "絵文字が数値参照に変わること" do
|
580
|
-
email = MobileMailer.receive(@email)
|
581
|
-
|
582
|
-
email.subject.should match(//)
|
583
|
-
email.body.should match(//)
|
584
|
-
end
|
585
|
-
end
|
586
|
-
|
587
|
-
describe "utf-8 のとき" do
|
588
|
-
before(:each) do
|
589
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/softbank-emoji-utf8.eml").read
|
590
|
-
end
|
591
|
-
|
592
|
-
it "漢字コードを適切に変換できること" do
|
593
|
-
email = MobileMailer.receive(@email)
|
594
|
-
|
595
|
-
email.subject.should match(/題名/)
|
596
|
-
email.body.should match(/本文/)
|
597
|
-
end
|
598
|
-
|
599
|
-
it "絵文字が数値参照に変わること" do
|
600
|
-
email = MobileMailer.receive(@email)
|
601
|
-
|
602
|
-
email.subject.should match(//)
|
603
|
-
email.body.should match(//)
|
604
|
-
end
|
605
|
-
end
|
606
|
-
end
|
607
|
-
|
608
|
-
describe "multipart メールを受信するとき" do
|
609
|
-
describe "docomo の場合" do
|
610
|
-
# NOTE: キャリアメールサーバで絵文字を変換するため検証は困難
|
611
|
-
before(:each) do
|
612
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/docomo-gmail-sjis.eml").read
|
613
|
-
end
|
614
|
-
|
615
|
-
it "正常に受信できること" do
|
616
|
-
lambda {
|
617
|
-
MobileMailer.receive(@email)
|
618
|
-
}.should_not raise_exception
|
619
|
-
end
|
620
|
-
|
621
|
-
it "絵文字が変換されること" do
|
622
|
-
email = MobileMailer.receive(@email)
|
623
|
-
|
624
|
-
email.subject.should match(//)
|
625
|
-
|
626
|
-
email.parts.size.should == 1
|
627
|
-
email.parts.first.parts.size == 2
|
628
|
-
|
629
|
-
parts = email.parts.first.parts
|
630
|
-
parts.first.body.should match("テストです")
|
631
|
-
parts.last.body.raw_source.should match("テストです")
|
632
|
-
end
|
633
|
-
end
|
634
|
-
|
635
|
-
describe "au の場合" do
|
636
|
-
before(:each) do
|
637
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/au-decomail.eml").read
|
638
|
-
end
|
639
|
-
|
640
|
-
it "正常に受信できること" do
|
641
|
-
lambda {
|
642
|
-
MobileMailer.receive(@email)
|
643
|
-
}.should_not raise_exception
|
644
|
-
end
|
645
|
-
|
646
|
-
it "絵文字が変換されること" do
|
647
|
-
email = MobileMailer.receive(@email)
|
648
|
-
|
649
|
-
email.subject.should match(//)
|
650
|
-
|
651
|
-
email.parts.size.should == 1
|
652
|
-
email.parts.first.parts.size == 2
|
653
|
-
|
654
|
-
parts = email.parts.first.parts
|
655
|
-
parts.first.body.should match(/テストです/)
|
656
|
-
parts.last.body.raw_source.should match(/テストです/)
|
657
|
-
end
|
658
|
-
end
|
659
|
-
|
660
|
-
describe "softbank(sjis) の場合" do
|
661
|
-
# NOTE: キャリアメールサーバで絵文字を変換するため検証は困難
|
662
|
-
before(:each) do
|
663
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/softbank-gmail-sjis.eml").read
|
664
|
-
end
|
665
|
-
|
666
|
-
it "正常に受信できること" do
|
667
|
-
lambda {
|
668
|
-
MobileMailer.receive(@email)
|
669
|
-
}.should_not raise_exception
|
670
|
-
end
|
671
|
-
|
672
|
-
it "絵文字が変換されること" do
|
673
|
-
email = MobileMailer.receive(@email)
|
674
|
-
|
675
|
-
email.subject.should match(//)
|
676
|
-
|
677
|
-
email.parts.size.should == 2
|
678
|
-
|
679
|
-
email.parts.first.body.should match(/テストです/)
|
680
|
-
email.parts.last.body.raw_source.should match(/テストです/)
|
681
|
-
end
|
682
|
-
end
|
683
|
-
|
684
|
-
describe "softbank(utf8) の場合" do
|
685
|
-
# NOTE: キャリアメールサーバで絵文字を変換するため検証は困難
|
686
|
-
before(:each) do
|
687
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/softbank-gmail-utf8.eml").read
|
688
|
-
end
|
689
|
-
|
690
|
-
it "正常に受信できること" do
|
691
|
-
lambda {
|
692
|
-
MobileMailer.receive(@email)
|
693
|
-
}.should_not raise_exception
|
694
|
-
end
|
695
|
-
|
696
|
-
it "絵文字が変換されること" do
|
697
|
-
email = MobileMailer.receive(@email)
|
698
|
-
|
699
|
-
email.subject.should match(/テストです/)
|
700
|
-
|
701
|
-
email.parts.size.should == 2
|
702
|
-
|
703
|
-
email.parts.first.body.should match(/テストです/)
|
704
|
-
email.parts.last.body.raw_source.should match(/テストです/)
|
705
|
-
end
|
706
|
-
end
|
707
|
-
|
708
|
-
describe "添付ファイルがある場合" do
|
709
|
-
# NOTE: au のみテスト
|
710
|
-
before(:each) do
|
711
|
-
@email = open(Rails.root + "spec/fixtures/mobile_mailer/au-attached.eml").read
|
712
|
-
end
|
713
|
-
|
714
|
-
it "正常に受信できること" do
|
715
|
-
lambda {
|
716
|
-
MobileMailer.receive(@email)
|
717
|
-
}.should_not raise_exception
|
718
|
-
end
|
719
|
-
|
720
|
-
it "添付ファイルが壊れないこと" do
|
721
|
-
email = MobileMailer.receive(@email)
|
722
|
-
|
723
|
-
email.subject.should match(//)
|
724
|
-
|
725
|
-
email.parts.size.should == 2
|
726
|
-
|
727
|
-
email.parts.first.body.should match(/カレンダーだ/)
|
728
|
-
|
729
|
-
email.has_attachments?.should be_true
|
730
|
-
email.attachments.size.should == 1
|
731
|
-
email.attachments['20098calendar01.jpg'].content_type.should match("image/jpeg")
|
732
|
-
email.attachments['20098calendar01.jpg'].body.to_s[2..6] == "JFIF"
|
733
|
-
email.attachments['20098calendar01.jpg'].body.to_s.size == 86412
|
734
|
-
end
|
735
|
-
end
|
736
|
-
end
|
737
|
-
end
|