以下の問いに答えられるようにする。
- その機能を利用できるのはユーザー何%か?(ユーザーのプランによって利用可否がある場合など)、頻繁に利用されているか?
- それらのユーザーの生み出す収益は何%か?
RSpec.configure do |config| | |
config.before(:each) do |example| | |
# Poltergeistの言語設定をja,enにする | |
if example.metadata[:type] == :feature && example.metadata[:js] | |
page.driver.headers = { | |
'Accept-Language' => 'ja,en', | |
} | |
end | |
end | |
end |
以下の問いに答えられるようにする。
Why use Event Sourcing - Arkency Blog
describe Foo do | |
describe '.process', active_job: true do | |
it 'キューにジョブを2件保存する' do | |
expect { | |
described_class.process | |
}.to change{ActiveJob::Base.queue_adapter.enqueued_jobs.size}.by(2) | |
end | |
end | |
end |
require 'octokit' | |
owner = 'juno' | |
repo = 'foo' | |
branch_name = 'fix-issue-1' | |
Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) | |
pull_id = client.pulls("#{owner}/#{repo}", head: "#{owner}:#{branch_name}").first.number |
Original: 5 mistakes we all make with product feedback
Original: https://segment.com/blog/calculating-customer-acquisition-costs/
算出式は以下のとおり。
$ rails c
> puts 'Hello'
Hello
=> nil
> capture(:stdout) { puts 'Hello' }
=> "Hello\n"
it 'Qnyp::Episodes::CalculateEpisodeRatingSummary.process を呼び出す' do | |
user = FactoryGirl.create(:user) | |
# Spyによる監視を行うためには、このようにオブジェクトやメソッドを監視するコードは必要 | |
allow(Qnyp::Episodes::CalculateEpisodeRatingSummary).to receive(:process) | |
get :show | |
expect(Qnyp::Episodes::CalculateEpisodeRatingSummary) | |
.to have_received(:process) | |
.with(user) | |
end |
it 'Qnyp::Episodes::CalculateEpisodeRatingSummary.process を呼び出す' do | |
user = FactoryGirl.create(:user) | |
expect(Qnyp::Episodes::CalculateEpisodeRatingSummary) | |
.to receive(:process) | |
.with(user) | |
get :show | |
end |