我是一个尝试学习rails的初学者。当我试图运行"rails test“命令时,我得到了这样的消息。我不明白这是什么意思:/
rails test
Running via Spring preloader in process 46753
/Users/.../.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require': /Users/..../test/controllers/static_pages
当我使用rake test:helpers运行我的helpers测试时,出现了奇怪的错误。
ApplicationHelper::dummy#test_0001_must返回字符串: NameError:无法解析ApplicationHelper::dummy的控制器
测试:
require "test_helper"
describe ApplicationHelper do
include ApplicationHelper
context "dummy" do
it "must return string" do
我正在尝试将Rails更新为5.0.0.beta 1,并得到如下所示的错误:
Bundler could not find compatible versions for gem "minitest":
In Gemfile:
rails (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
activejob (= 5.0.0.beta1) was resolved to 5.0.0.beta1, which depends on
activesupport (= 5.0.0.bet
我在Rails 4.2中使用Cucumber with Capybara,但我不使用RSpec。我一直在和Minitest在一起。在我的大多数测试中,我都使用了minitest:spec。
每当我试图在Cucumber步骤中使用使用最小或最小:spec语法的make断言时,我就会得到一个错误,说明断言方法是未定义的。例如,这一步:
Then (/^the state selector has no states$/) do
page.wont_have_selector(".my-css-class", :visible)
end
给出这个错误
undefined meth
当我尝试运行我的请求规范时,收到以下错误:
POST :: /users/:id/authentications request::successful request#test_0001_Adds an authentication record to a user:
NoMethodError: undefined method `post' for #<#<Class:0x007fa607163028>:0x007fa6070012c0>
test/requests/authentications_test.rb:9:in `block (3 leve
当尝试启动服务器rails s时,我得到了
Could not find minitest-5.9.0 in any of the sources
Run `bundle install` to install missing gems.
我做了gem install minitest -v 5.9.0
已成功安装minitest-5.9.0
已安装1个gem
也就是gem list
minitest (5.9.0, 4.7.5)
但是当我再次尝试rails s时,我收到了同样的错误。
我怎么才能修复它呢?
我是Rails的初学者,正在编写Michael Hartl创建的"Ruby- on -Rails“教程。我到了他开始谈论"rails test“命令的时候,但当我运行它时,它给了我以下错误:
D:/Cours/3eme année/Ruby On Rails/rubyonrails_ebook/workspace/sample_app/test/controllers/static_pages_controller_test.rb:1:in `require': cannot load such file -- test_helper (LoadError)
f
我和Minitest玩了一会儿,发现了一些我似乎找不到解释的行为
我有一个非常简单的模型测试文件如下:
require 'minitest_helper'
describe User do
before do
@user = User.new(name: "Example User", email: "user@example.com",
password: "foobards", password_confirmation: "foobards")
e
我正在阅读Michael编写的Rails教程,并继续阅读。但是,当我尝试做一些测试时,我遇到了一些问题。
[fran@fran-desktop twitter-clone]$ bundle exec rake test
/media/Data.II/Dropbox/Web Development/odin-project/3. Ruby on Rails/twitter-clone/db/schema.rb doesn't exist yet. Run `rake db:migrate` to create it, then try again. If you do not inten
我正在使用一个openshift rails应用程序,它是我克隆到本地机器上的。GEM文件在各种环境中定义后端
group :development, :test do
gem 'sqlite3'
gem 'minitest'
gem 'thor'
end
# Add support for the MySQL
group :production, :mysql do
gem 'mysql2'
end
group :production, :postgresql do
gem 'pg'
en