Commit fc4da17759a3ca15443aab42cfa9d25af75e8821
Committed by
Rafael Manzo
1 parent
1e2f7c54
Exists in
colab
and in
4 other branches
Covered project Edit method with unit tests
Showing
1 changed file
with
15 additions
and
0 deletions
Show diff stats
spec/controllers/projects_controller_spec.rb
... | ... | @@ -77,4 +77,19 @@ describe ProjectsController do |
77 | 77 | |
78 | 78 | it { should render_template(:index) } |
79 | 79 | end |
80 | + | |
81 | + describe 'edit' do | |
82 | + before :each do | |
83 | + @subject = FactoryGirl.build(:project) | |
84 | + Project.expects(:find).with(@subject.id.to_s).returns(@subject) | |
85 | + get :edit, :id => @subject.id | |
86 | + end | |
87 | + | |
88 | + it { should render_template(:edit) } | |
89 | + | |
90 | + it 'should assign to @project the @subject' do | |
91 | + assigns(:project).should eq(@subject) | |
92 | + end | |
93 | + end | |
94 | + | |
80 | 95 | end | ... | ... |