spec/rack/jpmobile/emoticon_spec.rb in jpmobile-1.0.6 vs spec/rack/jpmobile/emoticon_spec.rb in jpmobile-1.0.7
- old
+ new
@@ -55,46 +55,50 @@
pending "emoticon.yaml and emoticons directory don't exists"
end
@res = Rack::MockRequest.env_for("/", 'Content-Type' => 'text/html; charset=utf-8')
- Jpmobile::Rack::Filter.pc_emoticon_yaml = "tmp/emoticon.yaml"
- Jpmobile::Rack::Filter.pc_emoticon_image_path = @path = "tmp/emoticons"
+ Jpmobile::Emoticon.pc_emoticon_yaml = "tmp/emoticon.yaml"
+ Jpmobile::Emoticon.pc_emoticon_image_path = @path = "tmp/emoticons"
end
after(:each) do
- Jpmobile::Rack::Filter.pc_emoticon_yaml = nil
- Jpmobile::Rack::Filter.pc_emoticon_image_path = nil
+ Jpmobile::Emoticon.pc_emoticon_yaml = nil
+ Jpmobile::Emoticon.pc_emoticon_image_path = nil
end
+ it "Jpmobile::Emoticon.pc_emoticon? がtrueになること" do
+ Jpmobile::Emoticon.pc_emoticon?.should be_true
+ end
+
it "docomo 絵文字が画像に変換されること" do
response = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@docomo_cr))).call(@res)[2]
response_body(response).should == "<img src=\"#{@path}/sun.gif\" alt=\"sun\" />"
end
- it "docomo 絵文字コードの埋込みは変換されないこと" do
+ it "docomo 絵文字コードが画像に変換されること" do
response = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@docomo_utf8))).call(@res)[2]
- response_body(response).should == @docomo_utf8
+ response_body(response).should == "<img src=\"#{@path}/sun.gif\" alt=\"sun\" />"
end
it "au 絵文字が画像に変換されること" do
response = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@au_cr))).call(@res)[2]
response_body(response).should == "<img src=\"#{@path}/sun.gif\" alt=\"sun\" />"
end
- it "au 絵文字コードの埋込みは変換されないこと" do
+ it "au 絵文字コードが画像に変換されること" do
response = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@au_utf8))).call(@res)[2]
- response_body(response).should == @au_utf8
+ response_body(response).should == "<img src=\"#{@path}/sun.gif\" alt=\"sun\" />"
end
it "softbank 絵文字が画像に変換されること" do
response = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
response_body(response).should == "<img src=\"#{@path}/sun.gif\" alt=\"sun\" />"
end
- it "softbank 絵文字コードの埋込みは変換されないこと" do
+ it "softbank 絵文字コードが画像に変換されること" do
response = Jpmobile::Rack::MobileCarrier.new(Jpmobile::Rack::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
- response_body(response).should == @softbank_utf8
+ response_body(response).should == "<img src=\"#{@path}/sun.gif\" alt=\"sun\" />"
end
end
context "docomo のとき" do
before(:each) do