Last active
January 28, 2019 03:17
-
-
Save alvin2ye/adf04cb32d2dba79d1424a3d70b2bbee to your computer and use it in GitHub Desktop.
Revisions
-
alvin2ye revised this gist
Jan 28, 2019 . No changes.There are no files selected for viewing
-
alvin2ye revised this gist
Jan 28, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ # curl -sSL https://git.io/generate_test_file | ruby - "app/controllers/wechat_platform/official_accounts/webhooks_controller.rb" # generate spec/requests/wechat_platform/official_accounts/webhooks_controller_spec.rb require "FileUtils" -
alvin2ye revised this gist
Jan 28, 2019 . No changes.There are no files selected for viewing
-
alvin2ye revised this gist
Jan 28, 2019 . 1 changed file with 7 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,31 +4,20 @@ require "FileUtils" rbfile = ARGV.first test_file = rbfile.gsub(/^app\/controller/, "spec/request").gsub(/_controller\.rb$/, "_controller_spec.rb") FileUtils.mkdir_p(File.dirname(test_file)) body = <<-EOF require "rails_helper" RSpec.describe "WechatPlatform::OfficialAccounts::WebhooksController", type: :request do it "show" do get "/wechat_platform/official_accounts/1/webhook", params: {echostr: "aa"} expect(response.body).to eq "aa" end end EOF puts "Generate #{test_file}" -
alvin2ye revised this gist
Jan 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ # curl -sSL https://gist.github.com/alvin2ye/adf04cb32d2dba79d1424a3d70b2bbee/raw/generate_test_file.rb | ruby - "app/controllers/wechat_platform/official_accounts/webhooks_controller.rb" # generate spec/controllers/wechat_platform/official_accounts/webhooks_controller_spec.rb require "FileUtils" -
alvin2ye revised this gist
Jan 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ require "FileUtils" rbfile = ARGV.first test_file = rbfile.gsub(/^app/, "spec/").gsub(/_controller\.rb$/, "_controller_spec.rb") FileUtils.mkdir_p(File.dirname(test_file)) -
alvin2ye revised this gist
Jan 27, 2019 . 1 changed file with 27 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,32 @@ test_file = rbfile.gsub(/^app/spec/).gsub(/_controller\.rb$/, "_controller_spec.rb") FileUtils.mkdir_p(File.dirname(test_file)) body = <<-EOF require 'rails_helper' RSpec.describe TradeSchemesController, :type => :controller do render_views describe "put finish_apply" do before do @trade = create_day_win_trade_scheme({}) end it "success" do expect(@trade.reload.status).to eq "are_confirm" put :finish_apply, id: @trade.id expect(JSON(response.body)['success']).to be true expect(@trade.reload.status).to eq "clearing_currency" end end end EOF puts "Generate #{test_file}" File.open(test_file, "w") do |f| f.puts body end -
alvin2ye renamed this gist
Jan 27, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
alvin2ye revised this gist
Jan 27, 2019 . 1 changed file with 12 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,12 @@ # echo http://a.rb | ruby - "app/controllers/wechat_platform/official_accounts/webhooks_controller.rb" # generate spec/controllers/wechat_platform/official_accounts/webhooks_controller_spec.rb require "FileUtils" rbfile = ARGV.first test_file = rbfile.gsub(/^app/spec/).gsub(/_controller\.rb$/, "_controller_spec.rb") FileUtils.mkdir_p(File.dirname(test_file)) File.open(test_file, "w") do |f| f.puts "" end -
alvin2ye renamed this gist
Jan 27, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
alvin2ye created this gist
Jan 27, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ p ["abc", $*, $1, ARGV]