Sha256: 291558ca40d059f530f66ca3b1305524ab10a9bae91cff776cb89aa5c2467e8d

Contents?: true

Size: 983 Bytes

Versions: 16

Compression:

Stored size: 983 Bytes

Contents

require "spec_helper"

describe Onebox::Engine::WechatMpOnebox do

  let(:link) { "https://mp.weixin.qq.com/s?__biz=MjM5NjM4MDAxMg==&mid=2655075181&idx=1&sn=7c58f17de2c687f4763f17359ecc6e72&chksm=bd5fb76e8a283e7856cae30a74e905a18d9511e81c047b6e12390889de15976fb2c297b04106#rd" }
  let(:html) { described_class.new(link).to_html }

  describe "#to_html" do
    before do
      fake("https://mp.weixin.qq.com/s?__biz=MjM5NjM4MDAxMg==&mid=2655075181&idx=1&sn=7c58f17de2c687f4763f17359ecc6e72&chksm=bd5fb76e8a283e7856cae30a74e905a18d9511e81c047b6e12390889de15976fb2c297b04106", response("wechat-mp"))
    end

    it "has the article's title" do
      expect(html).to include("不是月光宝盒,但也能回到过去")
    end

    it "has the article's description" do
      expect(html).to include("你知道吗?从今天起,公众号后台编辑文章时可以……")
    end

    it "has the article's author" do
      expect(html).to include("微信派")
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
onebox-1.8.39 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.38 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.36 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.35 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.34 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.33 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.32 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.31 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.30 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.29 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.28 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.27 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.26 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.25 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.24 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb
onebox-1.8.23 spec/lib/onebox/engine/wechat_mp_onebox_spec.rb