0.0
No commit activity in last 3 years
No release in over 3 years
A fakesite plugin that provides a stub method for wechat.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
>= 0

Runtime

>= 0.2.3
 Project Readme

fakesite-wechat

Build Status Coverage Status

A fakesite plugin that provides a stub method for wechat. It's useful to bypass oauth flow in develpment environment.

Installation

Add this line to your application's Gemfile:

gem 'fakesite-wechat', group: :development

And then execute:

$ bundle

Route

Make sure that you have added fakesite route in your config/route.rb

mount Fakesite::Engine => "/fakesite" if Rails.env.development?

Usage

Add registration to config/initializers/fakesite.rb

if Rails.env.development?
  WebMock.allow_net_connect!
  # fill data from devise current_user, you can change this to get correct data automatically
  options = {
  #   :nickname => :nickname,
  #   :sex => :sex, 
  #   :province => :province, 
  #   :city => :city, 
  #   :country => :country, 
  #   :headimgurl => :headimgurl
  }
  Fakesite.register :wechat, Fakesite::Wechat::Base, options
end

License

The gem is available as open source under the terms of the MIT License.

Contact

The project's website is located at https://github.com/emn178/fakesite-wechat
Author: Chen, Yi-Cyuan (emn178@gmail.com)