我用Rails(4.1.16)和Rspec(3.5.1)生成了一個腳手架。 它產生此試驗: describe "GET #show" do
it "assigns the requested team as @team" do
team = Team.create! valid_attributes
get :show, params: {id: team.to_pa
當在同一個描述塊中重複進行相同的調用時,例如, RSpec.describe Grant do
let(:grant) { Grant.make }
describe "#exchange!" do
it "destroys token" do
grant.exchange! # dry me up!
expect(grant).to be_
我是rails中的newbee。在執行測試代碼我收到以下錯誤 /usr/local/rvm/gems/ruby-2.3.1/gems/airbrake-ruby-1.4.4/lib/airbrake-ruby.rb:102:in `configure': the 'default' notifier was already configured (Airbrake::Error)
from /h
我努力學習rspec的和已經遇到了一個問題,我想測試我的車型之一的唯一性驗證,但測試不停地進行故障即使我敢肯定它應該通過。 這裏是我的測試: context "two products with the same title" do
Given{FactoryGirl.build(:product, title: "Hello test title")}
Given(:post