rspec-rails

    0熱度

    1回答

    呼籲 考慮以下幾點: 級美容師內 def groom_dogs client.dogs.groom end 和內部類犬 def self.groom all.groomable.update_all(:groomed, 1) end 你會如何驗證類接收的狗正確收集新郎? expect(Dog).to receive(:groom) 將驗證正確的方法是所謂的,但我

    1熱度

    1回答

    我有一個INSERT觸發器正則表達式檢查,沒有返回我的預期結果......但只有當在觸發器中運行。從我的SQL編輯器運行時,它按預期工作。 失敗觸發代碼(我加了RAISE來解決這個問題,我試圖去工作的代碼是低於IF發言): RAISE EXCEPTION 'postal_code regex check %', '55555' !~* '^\d{5}$'; IF NEW.postal_code

    1熱度

    2回答

    我有以下情況: EDITED 在我的routes.rb namespace :api, defaults: { format: :json } do namespace :v1 do # the definitions of other routes of my api # ... match '*path', to: 'unmatch_route#n

    0熱度

    1回答

    我正在嘗試使用rspec向我的控制器寫入測試。現在我有這樣的代碼: class Restream::CustomsController < Restream::BaseController def create @custom = Restream::Custom.new(custom_params) @custom.user_id = current_user.id

    0熱度

    1回答

    我有一個軌道應用程序,有一些引擎在相同的回購。這些旨在通過管理員爲「管理員」保留用於「支付」的付款和邏輯的邏輯。 效果幾乎完美。所有的TTD工作都在引擎文件夾中完成..他們每個人都有一個規格文件夾 我今天掙扎的是CircleCI不知道測試引擎。它似乎沒有在引擎中找到spec文件。 問:有誰知道如何將其他目錄添加到他們的圈rspec運行?

    0熱度

    1回答

    嗨,我的生活我無法找到我的rspec文件中的語法錯誤。我經歷了幾十次,卻找不到它。我可以用一組額外的眼睛來幫助我。繼承人我的規格文件: require 'rails_helper' RSpec.describe User, type: :model do let(:user) { User.create!(name: "Bloccit User", email: "[email pr

    0熱度

    1回答

    我想測試我的多態註釋創建操作,但我總是在rspec中沒有路由匹配錯誤。 class CommentsController < ApplicationController before_action :authenticate_user! def create @comment = @commentable.comments.new(comment_params)

    0熱度

    1回答

    當我打電話刪除rspec中的記錄似乎他們被永久刪除。我認爲這與工廠女孩有關。有沒有辦法測試軟性刪除偏執狂,工廠的女孩,鐵軌和rspec沒有做任何侵入?

    0熱度

    1回答

    我在rails 5中有小應用程序。我嘗試使用Rspec來測試它,但只讀模型失敗。 我只讀模型產品和正常模型ProductMsp。第二個是與產品關聯的所有價格列表,並存儲在Rails數據庫中。產品是與另一個數據庫的外部只讀連接,用於撤銷產品列表。 我添加了關聯到spec/factories/product_msps.rb的產品。 FactoryGirl.define do factory

    0熱度

    1回答

    在Rspec控制器測試中,我想檢查我正在測試的控制器中的實例變量的值。 例如, 控制器: class ThingsController < ApplicationController def index @things = Thing.all end end 規格: RSpec.describe UsersController, type: :controlle