More unit tests for HAML

This commit is contained in:
Cesy Avon
2012-09-12 12:42:22 -07:00
parent 173aad7dea
commit 7bd0c36162
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
require 'spec_helper'
describe 'devise/mailer/reset_password_instructions.html.erb', :type => "view" do
context "logged in" do
before(:each) do
@resource = mock_model(User)
@resource.stub!(:email).and_return("example@example.com")
@resource.stub!(:reset_password_token).and_return("joe")
render
end
it 'should have some of the right text' do
rendered.should contain 'Change my password'
rendered.should contain 'please ignore this email'
end
end
end

View File

@@ -0,0 +1,19 @@
require 'spec_helper'
describe 'devise/registrations/edit.html.erb', :type => "view" do
context "logged in" do
before(:each) do
@view.stub(:resource).and_return(User.new)
@view.stub(:resource_name).and_return("user")
@view.stub(:resource_class).and_return(User)
@view.stub(:devise_mapping).and_return(Devise.mappings[:user])
render
end
it 'should have some fields' do
rendered.should contain 'Email'
rendered.should contain 'Cancel my account'
end
end
end