mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-08-02 19:05:52 -04:00
More unit tests for HAML
This commit is contained in:
18
spec/views/devise/mailer/reset_password_instructions_spec.rb
Normal file
18
spec/views/devise/mailer/reset_password_instructions_spec.rb
Normal 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
|
||||
19
spec/views/devise/registrations/edit_spec.rb
Normal file
19
spec/views/devise/registrations/edit_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user