我已经在rspec测试中使用设计。这是我的测试 describe BooksController do
before(:all) do
@user = FactoryGirl.create(:user)
end
describe "GET index" do
it "shows list of current user books
我有以下代码: class Init
def initialize(global_options, options, args)
abort "Key file must be given!" if (key_file = args.first).nil?
begin
@secret = File.read(key_file)
rescue
我在使用同一字段(“电子邮件”)在两个表单上访问两个表单时遇到问题。如果我不手动睡觉,水豚似乎在测试的第二部分首次访问时找到“电子邮件”字段。 # visit the first form and fill out a subscription
visit new_front_form_subscription_path(@web_form_1.id)
fill_in "Email", wit
我正在为JSON API编写一些测试。使用控制器规格与render_views是否可以接受这样做?例如,如下所示: describe 'task028: Adding an Item via MenuHeader', task028: true do
it 'should create a new menu item' do
m=FactoryGirl.create(:men
我有测试模型的麻烦,通过功能/场景rspec的仪器计数 require 'spec_helper'
feature 'Registration' do
scenario 'Guest can sign up as individual' do
with_role(:guest)
sign_up(:client)
Individual.count.shou
我在我的一个类下一个代码: class Settings < ActiveRecord::Base
def self.current
@settings ||= Settings.where({ environment: Rails.env }).first_or_create!
end
# Other methods
end
基本行为: 它创建于第一