by aaronbrethorst · 13y ago · 0 comments
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. describe Article do
describe '#slug' do
before do
subject.title = "Testing with Test::Unit"
end
its(:slug) { should_not match(/[^\w-]/) }
its(:slug) { should_not match(/[A-Z]/) }
it 'replaces spaces with hyphens'
end
end expect(article.slug).to match(/[^\w-]/) article.slug.should == "testing-with-test-unit"