Ruby on rails RoR错误,文件或测试配置出现问题

Ruby on rails RoR错误,文件或测试配置出现问题,ruby-on-rails,ruby,ruby-on-rails-3,ruby-on-rails-4,rubygems,Ruby On Rails,Ruby,Ruby On Rails 3,Ruby On Rails 4,Rubygems,我完全知道我以前也问过类似的问题,但这次我有更多关于情况的细节 似乎我无法测试我的应用程序,因为我的文件或测试配置有问题 显然,这也被称为RoR错误 我使用的是cloud9开发环境,我的工作区运行的是ruby 2.3.0p0(2015-12-25修订版53290)[x86_64-linux] 以下是我的文件: source 'https://rubygems.org' gem 'devise' gem 'bootstrap-sass' #modernizr gem 'modernizr-ra

我完全知道我以前也问过类似的问题,但这次我有更多关于情况的细节

似乎我无法测试我的应用程序,因为我的文件或测试配置有问题

显然,这也被称为RoR错误

我使用的是cloud9开发环境,我的工作区运行的是ruby 2.3.0p0(2015-12-25修订版53290)[x86_64-linux]

以下是我的文件:

source 'https://rubygems.org'

gem 'devise'

gem 'bootstrap-sass'
#modernizr
gem 'modernizr-rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

gem 'haml-rails'
我的应用程序中有3个控制器,其中两个是模型。第三个控制器只是我用来处理主视图(主界面)的控制器,它不是一个模型

我生成了作为独立控制器的第三个模型,但其他两个控制器是我生成的脚手架的一部分。(客户和项目)

这是我的客户端控制器测试:

require 'test_helper'

class ClientsControllerTest < ActionController::TestCase
  setup do
    @client = clients(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:clients)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create client" do
    assert_difference('Client.count') do
      post :create, client: { name: @client.name, email: @client.email + "create" }
    end

    assert_redirected_to client_path(assigns(:client))
  end

  test "should show client" do
    get :show, id: @client
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @client
    assert_response :success
  end

  test "should update client" do
    patch :update, id: @client, client: { name: @client.name }
    assert_redirected_to client_path(assigns(:client))
  end

  test "should destroy client" do
    assert_difference('Client.count', -1) do
      delete :destroy, id: @client
    end

    assert_redirected_to clients_path
  end
end
require 'test_helper'

class IndexControllerTest < ActionController::TestCase
  test "should get index" do
    get :index
    assert_response :success
  end

  test "should get contact"  do 
    get :contact 
    assert_response:success

    assert_template layout: 'application'

    assert_select'title', 'My Notes'
    assert_select'h1', 'Contact Us' 
    assert_select 'p', 'Complete the following form to get in touch with us.' 
    end

end
projects.yml:

# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
  client: one
  project_description: MyText
  project_timescale: MyString
  title: MyString

two:
  client: two
  project_description: MyText
  project_timescale: MyString
  title: MyString

运行命令rake test:prepareNothing在运行命令时发生。我是否应该在之后运行rake测试?如果运行rake测试意味着您对Gemfile bro没有任何问题,您需要在其他地方找到问题。您是否获得某种stacktrace来帮助您找到问题?你能做到吗?
logs/test.log
是否包含可以帮助您找到错误来源的信息?我无法运行任何测试,这是主要问题
require 'test_helper'

class IndexControllerTest < ActionController::TestCase
  test "should get index" do
    get :index
    assert_response :success
  end

  test "should get contact"  do 
    get :contact 
    assert_response:success

    assert_template layout: 'application'

    assert_select'title', 'My Notes'
    assert_select'h1', 'Contact Us' 
    assert_select 'p', 'Complete the following form to get in touch with us.' 
    end

end
require 'test_helper'

class ClientTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end

  #tests to see if an empty client can be created
  test "no empty clients!" do
    client = Client.new
    client.save

    refute client.valid?
  end

  #checks if a valid client can be created
  test "should save valid clients" do
    client = Client.new

    client.name = "David"
    client.email = "example@gmail.com"

    client.save
    assert client.valid?
  end

  test "no duplicate emails" do

    client1 = Client.new
    client1.name = "David"
    client1.email = "example@gmail.com"
    client1.save
    assert client.valid?

    client2 = Client.new
    client2.name = "David"
    client2.email = "example@gmail.com"
    client2.save
    refute client.valid?
  end

end
require 'test_helper'

class ProjectTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end

  setup do
    @client = clients(:one)
  end

  test "no empty projects" do 
    project = Project.new
    project.save

    refute project.valid?
  end


  test "make valid projects" do
    project = Project.new

    project.title = "first project"
    project.project_description = "building a forum for a game clan"
    project.project_timescale = "1 month"

    project.save
    assert project.valid?
  end
end
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
  name: MyString
  email: MyText1

two:
  name: MyString
  email: MyText2
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
  client: one
  project_description: MyText
  project_timescale: MyString
  title: MyString

two:
  client: two
  project_description: MyText
  project_timescale: MyString
  title: MyString