Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lando-L
committed
Jan 4, 2017
1 parent
fce6ad4
commit b615725
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
subject "Email-Subject" | ||
content "Email-Content" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require 'rails_helper' | ||
|
||
describe Email do | ||
let(:valid_email) {FactoryGirl.build(:email) } | ||
let(:invalid_email) { FactoryGirl.build(:email, subject: nil) } | ||
let(:mulitline_email) { FactoryGirl.build(:email, content: "Email-content \n Email-Content") } | ||
|
||
it 'is buildd by factory' do | ||
expect(valid_email).to be_valid | ||
end | ||
|
||
it 'should not be valid without content' do | ||
expect(invalid_email).to_not be_valid | ||
end | ||
|
||
it 'should convert ruby line breaks to html <br>' do | ||
expect(mulitline_email).to_not include('\n') | ||
end | ||
end |