require "nicoquery/object_mapper/video_array"
require "fixture/video_array_sm20415650_sm9"
require "fixture/video_array_no_tags"
describe "NicoQuery::ObjectMapper::VideoArray" do
context "sm20415650" do
before do
xml = Fixture.video_array_sm20415650_sm9
@result = NicoQuery::ObjectMapper::VideoArray.new xml
end
subject { @result.movies[0] }
describe "#title" do
it "returns string of title" do
expect(subject.title).to eq "【Minecraft】まったりクラフター生活 ~最終日~【ゆっくり実況】"
end
end
describe "#video_id" do
it "returns number of mylist_id" do
expect(subject.video_id).to eq "sm20415650"
end
end
describe "#thread_id" do
it "returns number of mylist_id" do
expect(subject.thread_id).to eq 1364047834
end
end
describe "#publish_date" do
it "returns number of thread_id" do
expect(subject.publish_date).to eq Time.new(2013, 3, 23, 23, 10, 32)
end
end
describe "#thumbnail_url" do
it "returns number of thread_id" do
expect(subject.thumbnail_url).to eq "http://tn-skr3.smilevideo.jp/smile?i=20415650"
end
end
describe "#view_counter" do
it "returns number of view counter" do
expect(subject.view_counter).to be_a_kind_of(Fixnum)
end
end
describe "#comment_num" do
it "returns number of comment num" do
expect(subject.comment_num).to be_a_kind_of(Fixnum)
end
end
describe "#mylist_counter" do
it "returns number of mylist counter" do
expect(subject.mylist_counter).to be_a_kind_of(Fixnum)
end
end
describe "#description.raw_text" do
it "returns string of title" do
# mylistのrssでは、descriptionの全文取得はできず、頭から256文字までしか取得できない。
#
が勝手に
に変換されてしまう。noriのせい?
expect(subject.description.raw_text).to eq "最終日。
ひっそりまったり通常営業...かな?
ついにきました最終日。最後に最長の尺...画質が悪いかもです><
今まで本当にありがとうございました!最後にゆっくりまったりしていってね(*´ヮ`*)
シード値:-2086770116
使用MOD
1.Opti Fine
2.MinecraftIM
3.PlayerFormLittleMaid
4.Audiotori r2
5.littleMaidMob
+りばいあ製MOD×2(らいちんぐすてっき・ゆかり&らいちロボ)
sm20221817←29日目⇔新シリーズ→sm21615389
シリーズまとめ→mylist/29017292
他に作ったもの→mylist/29022355
twitter⇒http://twitter.com/raichi_J
コミュco1590050
いただいたイラストclip/577830
ゆかりテクスチャim2807664
moyuさん作・ゆかりさんと私のメイドモデルim2466837"
# expect(subject.description.raw_text).to eq <<-EOS
# 最終日。
ひっそりまったり通常営業...かな?
ついにきました最終日。最後に最長の尺...画質が悪いかもです><
今まで本当にありがとうございました!最後にゆっくりまったりしていってね(*´ヮ`*)
シード値:-2086770116
使用MOD
1.Opti Fine
2.MinecraftIM
3.PlayerFormLittleMaid
4.Audiotori r2
5.littleMaidMob
+りばいあ製MOD×2(らいちんぐすてっき・ゆかり&らいちロボ)
sm20221817←29日目⇔新シリーズ→sm21615389
シリーズまとめ→mylist/29017292
他に作ったもの→mylist/29022355
twitter⇒http://twitter.com/raichi_J
コミュco1590050
いただいたイラストclip/577830
ゆかりテクスチャim2807664
moyuさん作・ゆかりさんと私のメイドモデルim2466837
# EOS
end
end
describe "#description.mylist_references" do
it "returns number of mylist references" do
expect(subject.description.mylist_references).to eq [29017292, 29022355]
end
end
describe "#tags" do
it "returns number of mylist references" do
expect(subject.tags).to be_a_kind_of Array
end
end
end
context "when a movie doesn't contain more than one tag" do
before do
xml = Fixture.video_array_sm20415650_sm9
@result = NicoQuery::ObjectMapper::VideoArray.new xml
end
subject { @result.movies[0] }
describe "#tags" do
it "returns number of mylist references" do
expect(subject.tags).to be_a_kind_of Array
end
end
end
context "when a movie contains no tag" do
before do
xml = Fixture.video_array_no_tags
@result = NicoQuery::ObjectMapper::VideoArray.new xml
end
subject { @result.movies[0] }
describe "#tags" do
it "returns empty array" do
expect(subject.tags).to be_a_kind_of Array
expect(subject.tags).to be_empty
end
end
end
end