|
|
|
|
|
by aaronbrethorst
4844 days ago
|
|
I hate to be that guy, but the Rspec tests should be written more like the following: describe 'Article' do
let(:article) { Article.new }
describe '#slug' do
before(:each) do
article.title = "Testing with Test::Unit"
end
it 'does not contain non-alphabetical characters' do
article.slug.should_not match(/[^\w-]/)
end
it 'does not contain capital letters' do
article.slug.should_not match(/[A-Z]/)
end
it 'replaces spaces with hyphens'
end
end
Note: I almost certainly misinterpreted the first Regex. 'now you have two problems,' etc. etc. |
|