rspec-rails को आजमाएं। मुझे एक अजीब त्रुटि मिलती है - कोई मार्ग नहीं माना जाता है, भले ही मैं रेलों को चलाते समय ब्राउज़र में उन्हें ठीक से एक्सेस कर सकूं।rspec-rails: विफलता/त्रुटि: "/" कोई मार्ग मिलान नहीं
मैं भी बस/
Failure/Error: get "/"
ActionController::RoutingError:
No route matches {:controller=>"action_view/test_case/test", :action=>"/"}
साथ इसे करने की कोशिश मैं निश्चित रूप से पहुँच/और, ब्राउज़र में अन्य संसाधनों हालांकि कर सकते हैं। क्या आरएसपीसी सेट करते समय मुझे कुछ याद आ सकता है? मैंने इसे Gemfile में रखा और rspec भाग गया: स्थापित करें।
धन्यवाद, MRB
संपादित करें:
myApp::Application.routes.draw do
resources :groups do
resources :projects
end
resources :projects do
resources :variants
resources :steps
member do
get 'compare'
end
end
resources :steps do
resources :costs
end
resources :variants do
resources :costs
end
resources :costs
root :to => "home#index"
end
मेरे spec_helper.rb:
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.mock_with :rspec
config.include RSpec::Rails::ControllerExampleGroup
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
end
नहीं आया यहाँ अपने परीक्षण
1 require 'spec_helper'
2
3 describe "resource" do
4 describe "GET" do
5 it "contains /" do
6 get "/"
7 response.should have_selector("h1", :content => "Project")
8 end
9 end
10 end
यहाँ मेरी मार्ग फ़ाइल है वास्तव में नहीं मुझे कुछ भी बदलो, मुझे लगता है।
अपनी मार्ग फ़ाइल पोस्ट करें? – tbaums
क्या आप अपना spec_helper.rb पोस्ट कर सकते हैं? – moritz