Updated Rails to 2.1.0
[gitorious:georgyos-clone.git] / vendor / plugins / rspec_on_rails / spec / rails / autotest / mappings_spec.rb
1 require File.dirname(__FILE__) + '/../../spec_helper'
2 require File.join(File.dirname(__FILE__), *%w[.. .. .. lib autotest rails_rspec])
3 require File.join(File.dirname(__FILE__), *%w[.. .. .. .. rspec spec autotest_matchers])
4
5 describe Autotest::RailsRspec, "file mapping" do
6   before(:each) do
7     @autotest = Autotest::RailsRspec.new
8     @autotest.hook :initialize
9   end
10   
11   it "should map model example to model" do
12     @autotest.should map_specs(['spec/models/thing_spec.rb']).
13                             to('app/models/thing.rb')
14   end
15   
16   it "should map controller example to controller" do
17     @autotest.should map_specs(['spec/controllers/things_controller_spec.rb']).
18                             to('app/controllers/things_controller.rb')
19   end
20   
21   it "should map view.rhtml" do
22     @autotest.should map_specs(['spec/views/things/index.rhtml_spec.rb']).
23                             to('app/views/things/index.rhtml')
24   end
25   
26   it "should map view.rhtml with underscores in example filename" do
27     @autotest.should map_specs(['spec/views/things/index_rhtml_spec.rb']).
28                             to('app/views/things/index.rhtml')
29   end
30   
31   it "should map view.html.erb" do
32     @autotest.should map_specs(['spec/views/things/index.html.erb_spec.rb']).
33                             to('app/views/things/index.html.erb')
34   end
35   
36 end