-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a feature for tags and specs for articles and users
- Loading branch information
Showing
5 changed files
with
48 additions
and
4 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
@editor | |||
Feature: Article tags | |||
In order to organize the information | |||
As an editor | |||
I want to tag the articles | |||
|
|||
Scenario: Assign tags to an article | |||
Given I visit the articles index page | |||
And I click on 'New Article' | |||
And I fill the new article form with valid data | |||
And I tag the article with "foo, bar" | |||
When I click on 'Create' | |||
Then I should be redirected to the new article show page | |||
And I should see the newly created article | |||
And I should see the tags |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
Given /^I tag the article with "(.*)"$/ do |tags| | |||
fill_in 'article_tag_list', :with => tags | |||
end | |||
|
|||
Then /^I should see the tags$/ do | |||
within('.article .tags_list') do | |||
ActsAsTaggableOn::Tag.all.each do |tag| | |||
page.should have_selector('.tag', :text => tag.name) | |||
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,9 @@ | |||
require 'spec_helper' | require 'spec_helper' | ||
|
|
||
describe Article do | describe CargoWiki::Article do | ||
pending "add some examples to (or delete) #{__FILE__}" | it "validates the presence of the title" do | ||
@article = FactoryGirl.build(:article, :title => "") | |||
@article.save.should == false | |||
@article.errors.messages[:title].should include("can't be blank") | |||
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