Coder Social home page Coder Social logo

rspec-rails's People

Contributors

ahorek avatar alexrothenberg avatar alindeman avatar aried3r avatar benoittgt avatar billychan avatar bquorning avatar cupakromer avatar dchelimsky avatar drwl avatar eugeneius avatar fabn avatar javierjulio avatar jdax avatar jonrowe avatar justinko avatar kenzo-tanaka avatar klyonrad avatar morgoth avatar myronmarston avatar olleolleolle avatar petergoldstein avatar pirj avatar soulcutter avatar vivekmiyani avatar wbreeze avatar wincent avatar xaviershay avatar ydah avatar yujinakayama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rspec-rails's Issues

Controller specs should automatically have type

When describing a controller it has no type, so Rspec.configuration.include(Foo, :type => :controller) doesn't work.
While it is possible to specify it by hand, it would be nice if controllers have a type automatically (or the manual type declaration is generated in the file).

Generate the gem

There's no rspec-rails.gemspec file in the repository (I guess you generate it manually).
The effet to that is we can't use bundler to get and use the edge version.

Could it be possible to add the gemspec file ?

gemspec removed from git

Why was this removed from git? You can no longer use bundle install in Rails 3 to grab the latest version of rspec-rails.

Calling "cookies" in a controller test before the http action breaks

This should replicate the bug:

class SomeController < ApplicationController
  def test
    head :ok
  end
end

describe SomeController do
  it "should not blow up when setting a cookie" do
    cookies[:a] = "b"
    get :test
  end
end

This raises quite a cryptic error. I tracked down the problem to the interaction between the ActionDispatch::Integration::Runner and ControllerExampleGroupBehaviour:

def app 
  described_class.action(@_action).tap do |endpoint|
    def endpoint.routes
      Rails.application.routes
    end
  end
end

%w[get post put delete head].map do |method|
  eval <<-CODE
    def #{method}(*args)
      @_action = args.shift
      super '/', *args
    end
  CODE
end

When cookies gets called on the runner the integration_session gets set up with the app - but since @_action still hasn't been set the integration_session ends up with an app with no action. When post gets called @_action gets set, but the app has already been cached and the test request fails.

running a focused test with the 'spec' command doesn't work if the line_number is not the first line of an example or example group

here's the command i'm running, with the results summary next to each line

bundle exec spec /path/to/some_spec.rb --line_number=n

1.  require 'spec_helper'             # 0 examples, 0 failures
2.                                    # 0 examples, 0 failures
3.  describe 'something or other' do  # 2 examples, 1 failures
4.    it 'should pass' do             # 1 example,  0 failures
5.      true.should be_true           # 0 examples, 0 failures
6.    end                             # 0 examples, 0 failures
7.                                    # 0 examples, 0 failures
8.    it 'should fail' do             # 1 example,  1 failures
9.      fail                          # 0 examples, 0 failures
10.   end                             # 0 examples, 0 failures
11. end                               # 0 examples, 0 failures
12.                                   # 0 examples, 0 failures
  • rspec (2.0.0.beta.5)
  • rspec-core (2.0.0.beta.5)
  • rspec-expectations (2.0.0.beta.5)
  • rspec-mocks (2.0.0.beta.5)
  • rspec-rails (2.0.0.beta.5)

controller specs: params hash does not contain :action or :controller

I'm using CanCan for authorisation and it relies on params[:action] and params[:controller] to determine what resource to load for authorisation checks in a before filter. The specs work when CanCan is disabled so the routing etc is all correct.

The spec is:

describe "GET 'new'" do
  it "should be successful" do
    get 'new'
    response.should be_success
  end
end

I can see that the params hash is empty within the action method which is wrong as it should have the action and controller entries. I can work around this by modifying the spec for now, i.e.:
describe "GET 'new'" do
it "should be successful" do
get 'new', { :action => :new, :controller => :users }
response.should be_success
end
end

I suspect this is due to the usage of ActionDispatch::Integration as you mention on similar issues (http://rspec.lighthouseapp.com/projects/5645/tickets/963-request-is-nil and http://github.com/rspec/rspec-rails/issues#issue/10).

Not working generator (class_nesting_depth).

Using Ruby 1.9.1, Rails Edge, RSpec "Edge", RSpec-Rails "Edge". Generators configuration in application.rb

config.generators do |g|
  g.test_framework :rspec, :fixture => true, :views => false
  g.fixture_replacement :factory_girl, :dir => "spec/factories"
end

When trying to generate scaffolds RSpec causes exception:

$ rails generate scaffold foo
      invoke  active_record
      create    db/migrate/20100417161944_create_foos.rb
      create    app/models/foo.rb
      invoke    rspec
      create      spec/models/foo_spec.rb
(erb):1:in `template': undefined local variable or method `class_nesting_depth' for # (NameError)
    from /Users/alfanick/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/erb.rb:753:in `eval'
    from /Users/alfanick/.rvm/rubies/ruby-1.9.1-p378/lib/ruby/1.9.1/erb.rb:753:in `result'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/file_manipulation.rb:83:in `block in template'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:52:in `call'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:52:in `render'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:61:in `block (2 levels) in invoke!'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:61:in `open'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:61:in `block in invoke!'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/empty_directory.rb:114:in `call'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:59:in `invoke!'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions.rb:86:in `action'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/create_file.rb:24:in `create_file'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/actions/file_manipulation.rb:82:in `template'
    from /Volumes/WD Data/Projekty/Websites/photographers_catalog/lib/generators/rspec/model/model_generator.rb:10:in `create_test_file'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/task.rb:33:in `run'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:109:in `block in invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `each'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `map'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:267:in `block in _invoke_for_class_method'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/shell.rb:69:in `with_padding'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:256:in `_invoke_for_class_method'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:165:in `_invoke_from_option_test_framework'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/task.rb:33:in `run'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:109:in `block in invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `each'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `map'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:267:in `block in _invoke_for_class_method'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/shell.rb:69:in `with_padding'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:256:in `_invoke_for_class_method'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:165:in `_invoke_from_option_orm'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/task.rb:33:in `run'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:109:in `block in invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `each'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `map'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/invocation.rb:118:in `invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:36:in `block in start'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/base.rb:378:in `start'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/gems/thor-0.13.4/lib/thor/group.rb:29:in `start'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/generators.rb:163:in `invoke'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands/generate.rb:9:in `'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `block in require'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:195:in `block in load_dependency'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:523:in `new_constants_in'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:195:in `load_dependency'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/dependencies.rb:209:in `require'
    from /Users/alfanick/.rvm/gems/ruby-1.9.1-p378/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:30:in `'
    from script/rails:9:in `require'
    from script/rails:9:in `'

It's all about some class_nesting_depth, but I can't find anything useful online. Looks like a bug in lib/generators/rspec/model/model_generator.rb

Support view isolation in controller specs

Hi!

I read in the README file that view isolation is not implemented in controller specs. I'm missing it and thought it might be of some use to share that need here.

rspec-rails requires ActiveRecord regardless of whether the rails app is using it

I am using MongoMapper with Rails 3. My application specifically doesn't include active record. My application.rb looks like this

/config/application.rb
   3 %w(
   4   action_controller
   5   action_mailer
   6   active_resource
   7   rails/test_unit
   8 ).each do |framework|
   9   require "#{framework}/railtie"
  10 end

When I debug through the app, ActiveRecord is not loaded the line before "require 'rspec/rails'". However, it is directly after.

Unable to startup autospec due to an error in the rspec-rails gem

Hi,

When I try to start up autospec by running:

AUTOFEATURE=true autospec

Is resulting in:

/opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/rspec-rails-1.3.2/lib/autotest/rails_rspec.rb:36: undefined method `singularize' for "permissions":String (NoMethodError)

I tried to install various versions of the gem, rspec and ZenTest and in different combinations but I keep on getting those errors.

Is this something I'm doing wrong?
To me it seems Rails' inflections are not loaded at the time rspec-rails needs them...

Wout

undefined method `root' for Spec::Rails:Module

I've recently tried ruby 1.9.1 with my Rails apps. RSpec breaks with:

undefined method `root' for Spec::Rails:Module

This happens when I use things like Rails.root.join('spec', 'fixtures', 'bla.jpg') or Rails.env.production?

Obviously when I prefix Rails with :: the error goes away. On Ruby 1.8.7 the error doesn't exist.

Stubbing rails controller method causes failure on controller action call

Trying to stub a controller method throws an error when the controller action is called, e.g.:

controller.stub!(:current_host).and_return(Factory.build(:host))
post :create

Results in:

Failure/Error: post :create
can't convert nil into String
# (eval):3:in `post'

Removing the stub doesn't cause the error and the post is fails as expected. In fact even trying to dump the controller before the post causes this error (as I wasn't sure if it was still controller or had
been moved to an instance variable).

Request specs don't render templates

I've updated to recent (master) version of rspec-rails and noticed that request specs don't render templates anymore ("RSpec-generated template" text instead).
I've reverted to ref 38c04ca and it works there so it looks like recent changes to rendering broke things.

generated spec_helper.rb typo (missing '=')

./lib/generators/rspec/install/templates/spec/spec_helper.rb:

generates this:

config.use_transactional_examples false

But should generate this:

config.use_transactional_examples = false

Helper Specs

Helper specs get generated, but they are not really "helper specs" in that they offer no specific support yet for spec'ing helpers.

They need to:

  • provide a helper object which, in rspec-rails-1, is an instance of ActionView::Base
  • make sure the helper object has access to all of the rails helpers (link_to, url_for, etc)
  • make sure the helper object includes the helper being spec'd, so its methods can be accessed

render_template error

undefined method `keys' for nil:NilClass is raised when using render_template:

class PostsController < ApplicationController
  def show
    render :template => "posts/details"
  end
end

describe PostsController do
  it "should render the correct template" do
    get :show
    response.should render_template("posts/details")
  end
end
  • gem "rspec-rails", "2.0.0.beta.6"
  • gem "rails", "3.0.0.beta3"

Don't assume MyApp::Application is defined in initializer

I'm building several engines from individual apps for an in-house project, and I test them with rspec. When run as an engine, the MyApp::Application type is not loaded (and imho it shouldn't be, there's a separate MyApp::Engine that is loaded instead.)

To wit, rspec's generated initializer breaks in this situation, since MyApp::Application is unavailable. Appending "if defined? MyApp::Application" to the final "end" is enough to fix it.

View specs: response.should render_template fails

Hello there.

The following view spec produces this exception: "undefined method `assert_template' for #Rspec::Matchers::Matcher:0x482a600"

describe 'posts/show' do
  it "renders the article" do
    render
    response.should render_template('posts/_article')
  end
end

response returns an ActiveSupport::SafeBuffer object, is it normal?

I'm on the master branch, latest commit.

Autotest fails if test/ and spec/ folders are simultaneously in rails3 project

If I have spec/ (with real specs) and test/ (with scaffold tests) in rails project tree I got an error:

�[f/usr/lib/ruby/gems/svn/gems/rspec-rails-2.0.0.beta.8/lib/autotest/rails_rspec2.rb:36:in block (2 levels) in <top (required)>': undefined methodsingularize' for "companies":String (NoMethodError)
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:529:in call' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:529:intest_files_for'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:in block in find_files_to_test' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:ineach'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:in map' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:401:infind_files_to_test'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:256:in run_tests' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:245:inget_to_green'
from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:54:in get_to_green' from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:28:inblock in run'
from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:26:in loop' from /usr/lib/ruby/gems/svn/gems/cucumber-0.7.2/lib/autotest/cucumber_mixin.rb:26:inrun'
from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/lib/autotest.rb:135:in run' from /usr/lib/ruby/gems/svn/gems/autotest-4.2.10/bin/autotest:54:in<top (required)>'
from /usr/bin/autotest:19:in load' from /usr/bin/autotest:19:in'

But if I move test/ to test2/ all is ok.

My system settings:
Arch Linux x86_64
ruby 1.9.3dev (2010-05-08 trunk 27674) x86_64-linux
Rails 3.0.0.beta.3

# gem-svn list | grep rspec
rspec (2.0.0.beta.8)
rspec-core (2.0.0.beta.8)
rspec-expectations (2.0.0.beta.8)
rspec-mocks (2.0.0.beta.8)
rspec-rails (2.0.0.beta.8)

gem-svn list | grep autotest

autotest (4.2.10)
autotest-growl (0.2.4)
autotest-rails-pure (4.1.0)

Gemfile:


source 'http://rubygems.org'
gem 'rails', '3.0.0.beta3'
gem 'devise', '1.1.rc1'
gem 'mysql'
group :test do
gem 'database_cleaner'
gem 'rspec-rails', '>=2.0.0.beta.8'
gem 'rspec', '>=2.0.0.beta.8'

gem 'test-unit'

gem 'cucumber', '0.7.2'
gem 'cucumber-rails', '0.3.1'#, :git => 'git://github.com/aslakhellesoy/cucumber-rails.git'
gem 'capybara'

gem 'autotest'

gem 'autotest-rails-pure'
gem 'autotest-growl'
gem 'machinist'
end

as_new_record not working?

Hi!

post = mock_model(Post).as_new_record
post.new_record?.should be_true # fails

Is it implemented yet?

View specs: render :locals => {...}

Hi!

I'd like to spec a partial and I need to pass local variables to it. The render method in view specs does not allow any parameters, as it was the case with Rspec1. Is there another way to set locals for the view or is it currently missing from Rspec2?

Thanks!

Julien.

render in view spec defaults to "closest" subject

I am using RSpec-2 on a Rails 3 project.

I have a view spec similar to

describe "some_controller/index.html.haml" do
  it "renders some text" do
    render
    response.should contain "some text"
  end
  context "something specific" do
     it "renders something else" do
        render #breaks here
        response.should have_selector("a")
     end
  end
end

The second call to render breaks the spec because, by default it tries to render template "/something specific" or the description passed to context (describe). The render error is similar to:

Missing template /something specific with {:formats=>nil} in view path

I believe in rspec-1, rspec-rails-1.3.2 the second call to render would still, by default, render some_controller/index.html.haml.

assigns don't work on controller spec

on UserController.rb,i write following code :
@user = User.new

but on UserController spec file
assigns[:user].should_not be_nil # failed!!

assigns[:user] return nil alway.

Routing specs

Hello,

I'm trying to write some routing specs for my controller.
As you're doing in the routing generator : http://github.com/rspec/rspec-rails/blob/master/lib/generators/rspec/scaffold/templates/routing_spec.rb
I've creates spec/routing/controller_routing_spec.rb with my routing specs.

However I constantly get the two following errors :

undefined method `params_from' for #<Rspec::Core::ExampleGroup::Nested_5::Nested_6:0x10a07ae80>

undefined method `route_for' for #<Rspec::Core::ExampleGroup::Nested_5::Nested_6:0x10a07ae80>

I guess that's because routing specing isn't implemented yet. So I create this ticket as a "todo".

Error in rspec-rails.gemspec

spec/lib/rspec/rails/transactional_database_support_spec.rb doesn't exist.

should be spec/rspec/rails/transactional_database_support_spec.rb instead

provide alternative to "test/unit/assertionfailederror" on ruby1.9.1

It looks like this file does not exist in the standard library of ruby1.9.1..

/home/mbj/.gem/ruby/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:169:in require': no such file to load -- test/unit/assertionfailederror (LoadError) from /home/mbj/.gem/ruby/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:169:inrequire'
from /home/mbj/.bundle/ruby/1.9.1/gems/rspec-rails-2.0.0.a10/lib/rspec/rails/matchers.rb:2:in <top (required)>' from /home/mbj/.gem/ruby/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:169:inrequire'
from /home/mbj/.gem/ruby/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:169:in require' from /home/mbj/.bundle/ruby/1.9.1/gems/rspec-rails-2.0.0.a10/lib/rspec/rails.rb:2:in<top (required)>'
from /home/mbj/.gem/ruby/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:169:in require' from /home/mbj/.gem/ruby/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:169:inrequire'
from /home/mbj/devel/testapp/vehicles/spec/spec_helper.rb:5:in <top (required)>' from ./spec/controllers/vehicles_controller_spec.rb:1:inrequire'
from ./spec/controllers/vehicles_controller_spec.rb:1:in `

'

controller method misses from controller specs

Since rspec-rails 2.0.0.beta.8 there is no method called "controller". The instance variable is still in place. This might be consistent with test/unit (not sure), but is not consistent with previous versions of rspec.

Should use Rails module instead of constants

In the generated Rakefile and spec_helper, It should use Rails.root as it is meant to be used:

rspec.rake:

-spec_prereq = File.exist?(File.join(Rails.root, 'config', 'database.yml')) ? "db:test:prepare" : :noop
+spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop

spec_helper.rb:

-require File.dirname(FILE) + "/../config/environment" unless defined?(RAILS_ROOT)
+require File.dirname(FILE) + "/../config/environment" unless defined?(Rails)

NoSQL store adapters

Allow using non active_record or non sql/relational databases, such as document or key-value stores. Have an adapter API with a sample Adapter implementation fx for Mongo DB :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.