heartsentwined / ember-auth-rails-demo

rails + devise + ember-auth demo site
121 stars 16 forks source link

Can't get 'ember wildcard route' test to validate #5

Closed pzuraq closed 11 years ago

pzuraq commented 11 years ago

Hey, following the tutorial and it really is excellent, learning a bunch. I got to the ember wildcard route in Rails, and it doesn't appear to be working. The test fails with the following error:

 1) ember wildcard route routes to home#index
     Failure/Error: expect(get route).to route_to(
       No route matches "/a5391c190fbb7e9d0074f4fdca05a479"
     # ./spec/routing/ember_spec.rb:8:in `block (2 levels) in <top (required)>'

And when I load a random route into the app, I get the following error:

Uncaught Error: No route matched the URL '/askdjfbnaksdjnfaKJsd'

Any thoughts on what could be causing this? Or is this expected behavior?

heartsentwined commented 11 years ago

Please post your config/routes.rb.

pzuraq commented 11 years ago

Sure thing:

Swoppit::Application.routes.draw do  
  namespace :api do
    resources :cycles,           only: [:index, :show]
    resources :offers,           only: [:index, :show]
    resources :swopp_groups,     only: [:index, :show]
    resources :swoppable_images, only: [:index, :show]
    resources :swoppables,       only: [:index, :show]
    resources :users,            only: [:index, :show]
  end

  devise_for :users, controllers: {sessions: 'sessions'}

  root to: 'home#index'

  get '*ember' => 'home#index'
end
heartsentwined commented 11 years ago

Well routes.rb seems to be in order. Try restarting your server and spork (or guard, if you are following the tutorial), and see if it resolves. This had tripped me in my early days in rails, where any changes to routes.rb requires a server / spork restart.

pzuraq commented 11 years ago

Ah, that was it! Didn't realize I needed to restart Guard, I'm new to TDD in general. Thanks!

heartsentwined commented 11 years ago

Glad it helped