Skip to content

Please accept my suggestion for testing controllers with restricted access #464

Closed
wants to merge 13 commits into from
+293 −161
View
2 .yardopts
@@ -4,3 +4,5 @@
--markup markdown
-
README.md
+Changelog.md
+License.txt
View
28 DEV-README.md
@@ -0,0 +1,28 @@
+## Set up the dev environment
+
+ git clone git://github.com/rspec/rspec-rails.git
+ cd rspec-rails
+ gem install bundler
+ bundle install
+
+Now you should be able to run any of:
+
+ rake
+ rake spec
+ rake cucumber
+
+Or, if you prefer to use the rspec and cucumber commands directly, you can either:
+
+ bundle exec rspec
+
+Or ...
+
+ bundle install --binstubs
+ bin/rspec
+
+## Customize the dev enviroment
+
+The Gemfile includes the gems you'll need to be able to run specs. If you want
+to customize your dev enviroment with additional tools like guard or
+ruby-debug, add any additional gem declarations to Gemfile-custom (see
+Gemfile-custom.sample for some examples).
267 README.md
@@ -20,9 +20,11 @@ This installs the following gems:
Add `rspec-rails` to the `:test` and `:development` groups in the Gemfile:
- group :test, :development do
- gem "rspec-rails", "~> 2.6"
- end
+```ruby
+group :test, :development do
+ gem "rspec-rails", "~> 2.6"
+end
+```
It needs to be in the `:development` group to expose generators and rake
tasks without having to type `RAILS_ENV=test`.
@@ -45,39 +47,45 @@ Please note that the generators are there to help you get started, but they are
no substitute for writing your own examples, and they are only guaranteed to
work out of the box for the default scenario (`ActiveRecord` + `Webrat`).
+### Webrat and Capybara
+
+You can choose between webrat or capybara for simulating a browser, automating
+a browser, or setting expectations using the matchers they supply. Just add
+your preference to the Gemfile:
+
+```ruby
+gem "webrat"
+gem "capybara"
+```
+
### Autotest
The `rspec:install` generator creates an `.rspec` file, which tells Autotest
that you're using RSpec and Rails. You'll also need to add the ZenTest gem to
your Gemfile:
- gem "ZenTest"
+```ruby
+gem "ZenTest"
+```
At this point, if all of the gems in your Gemfile are installed in system
gems, you can just type `autotest`. If, however, Bundler is managing any gems
for you directly (i.e. you've got `:git` or `:path` attributes in the `Gemfile`),
you'll need to run `bundle exec autotest`.
-### Webrat and Capybara
-
-You can choose between webrat or capybara for simulating a browser, automating
-a browser, or setting expectations using the matchers they supply. Just add
-your preference to the Gemfile:
-
- gem "webrat"
- gem "capybara"
-
## Living on edge
Bundler makes it a snap to use the latest code for any gem your app depends on. For
rspec-rails, you'll need to point bundler to the git repositories for `rspec-rails`
and the other rspec related gems it depends on:
- gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git"
- gem "rspec", :git => "git://github.com/rspec/rspec.git"
- gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
- gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
- gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git"
+```ruby
+gem "rspec-rails", :git => "git://github.com/rspec/rspec-rails.git"
+gem "rspec", :git => "git://github.com/rspec/rspec.git"
+gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git"
+gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
+gem "rspec-mocks", :git => "git://github.com/rspec/rspec-mocks.git"
+```
Run `bundle install` and you'll have whatever is in git right now. Any time you
want to update to a newer head, just run `bundle update`.
@@ -103,14 +111,16 @@ See http://github.com/rspec/rspec-rails/issues
Request specs live in spec/requests.
- describe "widgets resource" do
- describe "GET index" do
- it "contains the widgets header" do
- get "/widgets/index"
- response.should have_selector("h1", :content => "Widgets")
- end
- end
+```ruby
+describe "widgets resource" do
+ describe "GET index" do
+ it "contains the widgets header" do
+ get "/widgets/index"
+ response.should have_selector("h1", :content => "Widgets")
end
+ end
+end
+```
Request specs mix in behavior from Rails' integration tests. See the
docs for ActionDispatch::Integration::Runner for more information.
@@ -125,18 +135,21 @@ available from Rails.
You can use RSpec expectations/matchers or Test::Unit assertions.
## `render_views`
+
By default, controller specs do not render views. This supports specifying
controllers without concern for whether the views they render work correctly
(NOTE: the template must exist, unlike rspec-rails-1. See Upgrade.md for more
information about this). If you prefer to render the views (a la Rails'
functional tests), you can use the `render_views` declaration in each example
group:
- describe SomeController do
- render_views
- ...
+```ruby
+describe SomeController do
+ render_views
+ # ...
+```
-### * Upgrade note
+### Upgrade note
`render_views` replaces `integrate_views` from rspec-rails-1.3
@@ -145,36 +158,42 @@ group:
Use `assigns(key)` to express expectations about instance variables that a controller
assigns to the view in the course of an action:
- get :index
- assigns(:widgets).should eq(expected_value)
+```ruby
+get :index
+assigns(:widgets).should eq(expected_value)
+```
# View specs
View specs live in spec/views, and mix in ActionView::TestCase::Behavior.
- describe "events/index.html.erb" do
- it "renders _event partial for each event" do
- assign(:events, [stub_model(Event), stub_model(Event)])
- render
- view.should render_template(:partial => "_event", :count => 2)
- end
- end
-
- describe "events/show.html.erb" do
- it "displays the event location" do
- assign(:event, stub_model(Event,
- :location => "Chicago"
- )
- render
- rendered.should contain("Chicago")
- end
- end
+```ruby
+describe "events/index.html.erb" do
+ it "renders _event partial for each event" do
+ assign(:events, [stub_model(Event), stub_model(Event)])
+ render
+ view.should render_template(:partial => "_event", :count => 2)
+ end
+end
+
+describe "events/show.html.erb" do
+ it "displays the event location" do
+ assign(:event, stub_model(Event,
+ :location => "Chicago"
+ ))
+ render
+ rendered.should contain("Chicago")
+ end
+end
+```
View specs infer the controller name and path from the path to the view
template. e.g. if the template is "events/index.html.erb" then:
- controller.controller_path == "events"
- controller.request.path_parameters[:controller] == "events"
+```ruby
+controller.controller_path == "events"
+controller.request.path_parameters[:controller] == "events"
+```
This means that most of the time you don't need to set these values. When
spec'ing a partial that is included across different controllers, you _may_
@@ -183,14 +202,18 @@ need to override these values before rendering the view.
To provide a layout for the render, you'll need to specify _both_ the template
and the layout explicitly. For example:
- render :template => "events/show", :layout => "layouts/application"
+```ruby
+render :template => "events/show", :layout => "layouts/application"
+```
## `assign(key, val)`
Use this to assign values to instance variables in the view:
- assign(:widget, stub_model(Widget))
- render
+```ruby
+assign(:widget, stub_model(Widget))
+render
+```
The code above assigns `stub_model(Widget)` to the `@widget` variable in the view, and then
renders the view.
@@ -200,64 +223,111 @@ instance variables you set will be transparently propagated into your views
(similar to how instance variables you set in controller actions are made
available in views). For example:
- @widget = stub_model(Widget)
- render # @widget is available inside the view
+```ruby
+@widget = stub_model(Widget)
+render # @widget is available inside the view
+```
RSpec doesn't officially support this pattern, which only works as a
side-effect of the inclusion of `ActionView::TestCase`. Be aware that it may be
made unavailable in the future.
-### * Upgrade note
+### Upgrade note
+
+```ruby
+# rspec-rails-1.x
+assigns[key] = value
-`assign(key, value)` replaces `assigns[key] = value` from rspec-rails-1.3
+# rspec-rails-2.x
+assign(key, value)
+```
## `rendered`
This represents the rendered view.
- render
- rendered.should =~ /Some text expected to appear on the page/
+```ruby
+render
+rendered.should =~ /Some text expected to appear on the page/
+```
+
+### Upgrade note
+
+```ruby
+# rspec-rails-1.x
+render
+response.should xxx
+
+# rspec-rails-2.x
+render
+rendered.should xxx
+```
-### * Upgrade note
+# Model specs
-`rendered` replaces `response` from rspec-rails-1.3
+Model specs live in spec/models.
+
+```ruby
+describe Articles do
+ describe ".recent" do
+ it "includes articles published less than one week ago" do
+ article = Article.create!(:published_at => Date.today - 1.week + 1.second)
+ Article.recent.should eq([article])
+ end
+
+ it "excludes articles published at midnight one week ago" do
+ article = Article.create!(:published_at => Date.today - 1.week)
+ Article.recent.should be_empty
+ end
+
+ it "excludes articles published more than one week ago" do
+ article = Article.create!(:published_at => Date.today - 1.week - 1.second)
+ Article.recent.should be_empty
+ end
+ end
+end
+```
# Routing specs
Routing specs live in spec/routing.
- describe "routing to profiles" do
- it "routes /profile/:username to profile#show for username" do
- { :get => "/profiles/jsmith" }.should route_to(
- :controller => "profiles",
- :action => "show",
- :username => "jsmith"
- )
- end
-
- it "does not expose a list of profiles" do
- { :get => "/profiles" }.should_not be_routable
- end
- end
+```ruby
+describe "routing to profiles" do
+ it "routes /profile/:username to profile#show for username" do
+ { :get => "/profiles/jsmith" }.should route_to(
+ :controller => "profiles",
+ :action => "show",
+ :username => "jsmith"
+ )
+ end
-### * Upgrade note
+ it "does not expose a list of profiles" do
+ { :get => "/profiles" }.should_not be_routable
+ end
+end
+```
+
+### Upgrade note
`route_for` from rspec-rails-1.x is gone. Use `route_to` and `be_routable` instead.
# Helper specs
Helper specs live in spec/helpers, and mix in ActionView::TestCase::Behavior.
- describe EventsHelper do
- describe "#link_to_event" do
- it "displays the title, and formatted date" do
- event = Event.new("Ruby Kaigi", Date.new(2010, 8, 27))
- # helper is an instance of ActionView::Base configured with the
- # EventsHelper and all of Rails' built-in helpers
- helper.link_to_event.should =~ /Ruby Kaigi, 27 Aug, 2010/
- end
- end
+```ruby
+describe EventsHelper do
+ describe "#link_to_event" do
+ it "displays the title, and formatted date" do
+ event = Event.new("Ruby Kaigi", Date.new(2010, 8, 27))
+ # helper is an instance of ActionView::Base configured with the
+ # EventsHelper and all of Rails' built-in helpers
+ helper.link_to_event.should =~ /Ruby Kaigi, 27 Aug, 2010/
end
+ end
+end
+```
# Matchers
@@ -268,9 +338,10 @@ of them simply delegate to Rails' assertions.
* Available in all specs.
* Primarily intended for controller specs
-<pre>
+```ruby
object.should be_a_new(Widget)
-</pre>
+```
+
Passes if the object is a `Widget` and returns true for `new_record?`
@@ -280,41 +351,47 @@ Passes if the object is a `Widget` and returns true for `new_record?`
In request and controller specs, apply to the response object:
- response.should render_template("new")
+```ruby
+response.should render_template("new")
+```
In view specs, apply to the view object:
- view.should render_template(:partial => "_form", :locals => { :widget => widget } )
+```ruby
+view.should render_template(:partial => "_form", :locals => { :widget => widget } )
+```
## `redirect_to`
* Delegates to assert_redirect
* Available in request and controller specs.
-<pre>
+```ruby
response.should redirect_to(widgets_path)
-</pre>
+```
## `route_to`
* Delegates to Rails' assert_routing.
* Available in routing and controller specs.
-<pre>
+```ruby
{ :get => "/widgets" }.should route_to(:controller => "widgets", :action => "index")
-</pre>
+```
## `be_routable`
Passes if the path is recognized by Rails' routing. This is primarily intended
to be used with `should_not` to specify routes that should not be routable.
- { :get => "/widgets/1/edit" }.should_not be_routable
+```ruby
+{ :get => "/widgets/1/edit" }.should_not be_routable
+```
-## Contribute
+# Contribute
See [http://github.com/rspec/rspec-dev](http://github.com/rspec/rspec-dev)
-## Also see
+# Also see
* [http://github.com/rspec/rspec](http://github.com/rspec/rspec)
* [http://github.com/rspec/rspec-core](http://github.com/rspec/rspec-core)
View
2 features/Upgrade.md
@@ -36,7 +36,7 @@ is what you need to change:
## Controller specs
-### islation from view templates
+### isolation from view templates
By default, controller specs do _not_ render view templates. This keeps
controller specs isolated from the content of views and their requirements.
View
39 lib/generators/rspec/scaffold/templates/controller_spec.rb
@@ -26,12 +26,19 @@
def valid_attributes
{}
end
+
+ # This should return the minimal values that should be in the session
+ # in order to pass any filters (such as authentication) required by
+ # <%= controller_class_name %>Controller, be sure to keep this updated too.
+ def valid_session
+ {}
+ end
<% unless options[:singleton] -%>
describe "GET index" do
it "assigns all <%= table_name.pluralize %> as @<%= table_name.pluralize %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
- get :index
+ get :index, {}, valid_session
assigns(:<%= table_name %>).should eq([<%= file_name %>])
end
end
@@ -40,22 +47,22 @@ def valid_attributes
describe "GET show" do
it "assigns the requested <%= ns_file_name %> as @<%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
- get :show, :id => <%= file_name %>.id
+ get :show, {:id => <%= file_name %>.to_param}, valid_session
assigns(:<%= ns_file_name %>).should eq(<%= file_name %>)
end
end
describe "GET new" do
it "assigns a new <%= ns_file_name %> as @<%= ns_file_name %>" do
- get :new
+ get :new, {}, valid_session
assigns(:<%= ns_file_name %>).should be_a_new(<%= class_name %>)
end
end
describe "GET edit" do
it "assigns the requested <%= ns_file_name %> as @<%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
- get :edit, :id => <%= file_name %>.id
+ get :edit, {:id => <%= file_name %>.to_param}, valid_session
assigns(:<%= ns_file_name %>).should eq(<%= file_name %>)
end
end
@@ -64,18 +71,18 @@ def valid_attributes
describe "with valid params" do
it "creates a new <%= class_name %>" do
expect {
- post :create, :<%= ns_file_name %> => valid_attributes
+ post :create, {:<%= ns_file_name %> => valid_attributes}, valid_session
}.to change(<%= class_name %>, :count).by(1)
end
it "assigns a newly created <%= ns_file_name %> as @<%= ns_file_name %>" do
- post :create, :<%= ns_file_name %> => valid_attributes
+ post :create, {:<%= ns_file_name %> => valid_attributes}, valid_session
assigns(:<%= ns_file_name %>).should be_a(<%= class_name %>)
assigns(:<%= ns_file_name %>).should be_persisted
end
it "redirects to the created <%= ns_file_name %>" do
- post :create, :<%= ns_file_name %> => valid_attributes
+ post :create, {:<%= ns_file_name %> => valid_attributes}, valid_session
response.should redirect_to(<%= class_name %>.last)
end
end
@@ -84,14 +91,14 @@ def valid_attributes
it "assigns a newly created but unsaved <%= ns_file_name %> as @<%= ns_file_name %>" do
# Trigger the behavior that occurs when invalid params are submitted
<%= class_name %>.any_instance.stub(:save).and_return(false)
- post :create, :<%= ns_file_name %> => {}
+ post :create, {:<%= ns_file_name %> => {}}, valid_session
assigns(:<%= ns_file_name %>).should be_a_new(<%= class_name %>)
end
it "re-renders the 'new' template" do
# Trigger the behavior that occurs when invalid params are submitted
<%= class_name %>.any_instance.stub(:save).and_return(false)
- post :create, :<%= ns_file_name %> => {}
+ post :create, {:<%= ns_file_name %> => {}}, valid_session
response.should render_template("new")
end
end
@@ -106,18 +113,18 @@ def valid_attributes
# receives the :update_attributes message with whatever params are
# submitted in the request.
<%= class_name %>.any_instance.should_receive(:update_attributes).with(<%= params %>)
- put :update, :id => <%= file_name %>.id, :<%= ns_file_name %> => <%= params %>
+ put :update, {:id => <%= file_name %>.to_param, :<%= ns_file_name %> => <%= params %>}, valid_session
end
it "assigns the requested <%= ns_file_name %> as @<%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
- put :update, :id => <%= file_name %>.id, :<%= ns_file_name %> => valid_attributes
+ put :update, {:id => <%= file_name %>.to_param, :<%= ns_file_name %> => valid_attributes}, valid_session
assigns(:<%= ns_file_name %>).should eq(<%= file_name %>)
end
it "redirects to the <%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
- put :update, :id => <%= file_name %>.id, :<%= ns_file_name %> => valid_attributes
+ put :update, {:id => <%= file_name %>.to_param, :<%= ns_file_name %> => valid_attributes}, valid_session
response.should redirect_to(<%= file_name %>)
end
end
@@ -127,15 +134,15 @@ def valid_attributes
<%= file_name %> = <%= class_name %>.create! valid_attributes
# Trigger the behavior that occurs when invalid params are submitted
<%= class_name %>.any_instance.stub(:save).and_return(false)
- put :update, :id => <%= file_name %>.id, :<%= ns_file_name %> => {}
+ put :update, {:id => <%= file_name %>.to_param, :<%= ns_file_name %> => {}}, valid_session
assigns(:<%= ns_file_name %>).should eq(<%= file_name %>)
end
it "re-renders the 'edit' template" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
# Trigger the behavior that occurs when invalid params are submitted
<%= class_name %>.any_instance.stub(:save).and_return(false)
- put :update, :id => <%= file_name %>.id, :<%= ns_file_name %> => {}
+ put :update, {:id => <%= file_name %>.to_param, :<%= ns_file_name %> => {}}, valid_session
response.should render_template("edit")
end
end
@@ -145,13 +152,13 @@ def valid_attributes
it "destroys the requested <%= ns_file_name %>" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
expect {
- delete :destroy, :id => <%= file_name %>.id
+ delete :destroy, {:id => <%= file_name %>.to_param}, valid_session
}.to change(<%= class_name %>, :count).by(-1)
end
it "redirects to the <%= table_name %> list" do
<%= file_name %> = <%= class_name %>.create! valid_attributes
- delete :destroy, :id => <%= file_name %>.id
+ delete :destroy, {:id => <%= file_name %>.to_param}, valid_session
response.should redirect_to(<%= index_helper %>_url)
end
end
View
53 lib/rspec/rails/example/controller_example_group.rb
@@ -14,41 +14,41 @@ module RSpec::Rails
#
# ### with fixtures
#
- # describe WidgetsController do
- # describe "GET index" do
- # fixtures :widgets
- #
- # it "assigns all widgets to @widgets" do
- # get :index
- # assigns(:widgets).should eq(Widget.all)
+ # describe WidgetsController do
+ # describe "GET index" do
+ # fixtures :widgets
+ #
+ # it "assigns all widgets to @widgets" do
+ # get :index
+ # assigns(:widgets).should eq(Widget.all)
+ # end
# end
# end
- # end
#
# ### with a factory
#
- # describe WidgetsController do
- # describe "GET index" do
- # it "assigns all widgets to @widgets" do
- # widget = Factory(:widget)
- # get :index
- # assigns(:widgets).should eq([widget])
+ # describe WidgetsController do
+ # describe "GET index" do
+ # it "assigns all widgets to @widgets" do
+ # widget = Factory(:widget)
+ # get :index
+ # assigns(:widgets).should eq([widget])
+ # end
# end
# end
- # end
#
# ## with stubs
#
- # describe WidgetsController do
- # describe "GET index" do
- # it "assigns all widgets to @widgets" do
- # widget = stub_model(Widget)
- # Widget.stub(:all) { widget }
- # get :index
- # assigns(:widgets).should eq([widget])
+ # describe WidgetsController do
+ # describe "GET index" do
+ # it "assigns all widgets to @widgets" do
+ # widget = stub_model(Widget)
+ # Widget.stub(:all) { [widget] }
+ # get :index
+ # assigns(:widgets).should eq([widget])
+ # end
# end
# end
- # end
#
# ## Matchers
#
@@ -79,10 +79,9 @@ module RSpec::Rails
# functional tests, you can tell controller groups to render the views in the
# app with the +render_views+ declaration:
#
- # describe WidgetsController do
- # render_views
- # ...
- #
+ # describe WidgetsController do
+ # render_views
+ # # ...
module ControllerExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
View
35 lib/rspec/rails/example/helper_example_group.rb
@@ -3,35 +3,38 @@
module RSpec::Rails
# Extends ActionView::TestCase::Behavior
#
- # == Examples
+ # Provides a `helper` object which mixes in the helper module being spec'd,
+ # along with `ApplicationHelper` (if present).
#
- # describe RoleBasedDisplayHelper do
- # describe "display_for" do
- # context "given the role of the current user" do
- # it "yields to the block" do
- # helper.stub(:current_user) { double(:roles => ['admin'] }
- # text = helper.display_for('admin') { "this text" }
- # text.should eq("this text")
+ # @example
+ #
+ # describe RoleBasedDisplayHelper do
+ # describe "display_for" do
+ # context "given the role of the current user" do
+ # it "yields to the block" do
+ # helper.stub(:current_user) { double(:roles => ['admin']) }
+ # text = helper.display_for('admin') { "this text" }
+ # text.should eq("this text")
+ # end
# end
- # end
#
- # context "given a different role that that of the current user" do
- # it "renders an empty String" do
- # helper.stub(:current_user) { double(:roles => ['manager'] }
- # text = helper.display_for('admin') { "this text" }
- # text.should eq("")
+ # context "given a different role that that of the current user" do
+ # it "renders an empty String" do
+ # helper.stub(:current_user) { double(:roles => ['manager']) }
+ # text = helper.display_for('admin') { "this text" }
+ # text.should eq("")
+ # end
# end
# end
# end
- # end
- #
module HelperExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
include ActionView::TestCase::Behavior
include RSpec::Rails::ViewAssigns
module ClassMethods
+ # @api private
def determine_default_helper_class(ignore)
described_class
end
View
1 lib/rspec/rails/example/model_example_group.rb
@@ -1,4 +1,5 @@
module RSpec::Rails
+ # The basis for model specs
module ModelExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
View
10 lib/rspec/rails/example/request_example_group.rb
@@ -1,16 +1,16 @@
module RSpec::Rails
# Extends ActionDispatch::Integration::Runner to work with RSpec.
#
- # == Matchers
+ # ## Matchers
#
# In addition to the stock matchers from rspec-expectations, request
# specs add these matchers, which delegate to rails' assertions:
#
- # response.should render_template(*args)
- # => delegates to assert_template(*args)
+ # response.should render_template(*args)
+ # # => delegates to assert_template(*args)
#
- # response.should redirect_to(destination)
- # => delegates to assert_redirected_to(destination)
+ # response.should redirect_to(destination)
+ # # => delegates to assert_redirected_to(destination)
module RequestExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
View
13 lib/rspec/rails/example/routing_example_group.rb
@@ -1,6 +1,19 @@
require "action_dispatch/testing/assertions/routing"
module RSpec::Rails
+ # Routing specs live in spec/routing. If `config/routes.rb` has nothing
+ # beyond `map.resources :thing`, then you probably don't need a routing spec,
+ # but they can be quite helpful when specifying non-standard routes.
+ #
+ # @example
+ #
+ # require 'spec_helper'
+ #
+ # describe "profiles routes" do
+ # it "routes /profiles/jdoe" do
+ # get("/profiles/jdoe").should route_to("profiles#show", :username => 'jdoe')
+ # end
+ # end
module RoutingExampleGroup
extend ActiveSupport::Concern
include RSpec::Rails::RailsExampleGroup
View
4 rspec-rails.gemspec
@@ -6,6 +6,7 @@ Gem::Specification.new do |s|
s.name = "rspec-rails"
s.version = RSpec::Rails::Version::STRING
s.platform = Gem::Platform::RUBY
+ s.license = "MIT"
s.authors = ["David Chelimsky"]
s.email = "rspec-users@rubyforge.org"
s.homepage = "http://github.com/rspec/rspec-rails"
@@ -15,8 +16,9 @@ Gem::Specification.new do |s|
s.rubyforge_project = "rspec"
s.files = `git ls-files -- lib/*`.split("\n")
+ s.files += ["License.txt"]
s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
- s.extra_rdoc_files = [ "README.md" ]
+ s.extra_rdoc_files = [ "README.md", "License.txt"]
s.rdoc_options = ["--charset=UTF-8"]
s.require_path = "lib"
Something went wrong with that request. Please try again.