Giter Site home page Giter Site logo

对weixin_rails_middleware Rspec测试的时候, WeixinRailsMiddleware::WeixinController#default_url_options 报错 about weixin_rails_middleware HOT 3 CLOSED

lanrion avatar lanrion commented on May 27, 2024
对weixin_rails_middleware Rspec测试的时候, WeixinRailsMiddleware::WeixinController#default_url_options 报错

from weixin_rails_middleware.

Comments (3)

lanrion avatar lanrion commented on May 27, 2024

param_xml = request.body.read
xml 字符串,放入body内。

from weixin_rails_middleware.

chanshunli avatar chanshunli commented on May 27, 2024

@lanrion
请问在哪里写 request.body = " xml...." ? 但问题是,在测试中,还没有等生成 @weixin_message,就先执行了default_url_options 方法的 @weixin_message.FromUserName 了 ,所以测试才会报错的.

要不这样改 ?

  before(:each) do
    WeixinRailsMiddleware::WeixinController.class_eval do
      protected
      def default_url_options(options={})
        { weichat_id: "o17q2s7mMOrwcFC8WT1BFgBJzAPE"}
      end
    end
  end

from weixin_rails_middleware.

lanrion avatar lanrion commented on May 27, 2024

这个还真没测试过。

from weixin_rails_middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.