1
정확한 테스트 용어를 아는 사람이 있습니까? RSpec에이GoogleDrive API에 대한 RSpec 테스트 작성 방법
it "sends the request into Google spreadsheet" do
expect{
post :create, request: FactoryGirl.attributes_for(:request)
}.to change(GoogleDrive::#some code that looks in the spreadsheet, :rows).by(1)
같은 것, 그래서 내 컨트롤러는 아래 참고로, 내가 지금까지 배운 내용에서
def save_spreadsheet
connection = GoogleDrive.login(ENV['g_username'], ENV['g_password'])
ss = connection.spreadsheet_by_title('Test')
ws = ss.worksheets[0]
row = 1 + ws.num_rows #finds last row
ws[row, 1] = self.name
...
ws.save
end