Skip to content

Commit

Permalink
features
Browse files Browse the repository at this point in the history
  • Loading branch information
Su Yan Fang committed Mar 1, 2012
1 parent 6d0a98a commit 4671894
Show file tree
Hide file tree
Showing 18 changed files with 603 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Gemfile
Expand Up @@ -50,4 +50,9 @@ group :development, :test do
gem 'rspec-rails', '>= 2.0.0.beta.20'
gem 'simplecov', :require => false
gem 'sqlite3'
gem 'cucumber-rails'
gem 'cucumber-rails-training-wheels' # some pre-fabbed step definitions
gem 'database_cleaner' # to clear Cucumber's test database between runs
gem 'capybara' # lets Cucumber pretend to be a web browser
gem 'launchy' # a useful debugging aid for user stories
end
41 changes: 41 additions & 0 deletions Gemfile.lock
Expand Up @@ -36,23 +36,50 @@ GEM
arel (2.0.10)
bluecloth (2.2.0)
builder (2.1.2)
capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
childprocess (0.3.1)
ffi (~> 1.0.6)
coderay (0.9.8)
columnize (0.3.6)
cucumber (1.1.9)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.9.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.3.0)
capybara (>= 1.1.2)
cucumber (>= 1.1.8)
nokogiri (>= 1.5.0)
cucumber-rails-training-wheels (1.0.0)
cucumber-rails (>= 1.1.1)
database_cleaner (0.7.1)
diff-lcs (1.1.3)
erubis (2.6.6)
abstract (>= 1.0.0)
factory_girl (2.2.0)
activesupport
ffi (1.0.11)
flickraw (0.9.5)
flickraw-cached (20110920)
flickraw (>= 0.9)
gherkin (2.9.0)
json (>= 1.4.6)
htmlentities (4.3.1)
i18n (0.5.0)
json (1.6.5)
json_pure (1.6.5)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
launchy (2.0.3)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mail (2.2.19)
Expand Down Expand Up @@ -115,12 +142,19 @@ GEM
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubypants (0.2.0)
rubyzip (0.9.6.1)
selenium-webdriver (2.13.0)
childprocess (>= 0.2.1)
ffi (~> 1.0.9)
json_pure
rubyzip
simplecov (0.6.1)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sqlite3 (1.3.5)
subexec (0.0.4)
term-ansicolor (1.0.7)
thor (0.14.6)
treetop (1.4.10)
polyglot
Expand All @@ -131,6 +165,8 @@ GEM
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
xpath (0.1.4)
nokogiri (~> 1.3)

PLATFORMS
ruby
Expand All @@ -141,12 +177,17 @@ DEPENDENCIES
acts_as_tree_rails3
addressable (~> 2.1.0)
bluecloth (>= 2.0.5)
capybara
coderay (~> 0.9)
cucumber-rails
cucumber-rails-training-wheels
database_cleaner
factory_girl (= 2.2.0)
flickraw-cached
htmlentities
json
kaminari
launchy
mini_magick (= 1.3.3)
pg
rails (= 3.0.10)
Expand Down
8 changes: 8 additions & 0 deletions config/cucumber.yml
@@ -0,0 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
5 changes: 4 additions & 1 deletion config/database.yml
Expand Up @@ -3,7 +3,7 @@ development:
database: db/db_development
timeout: 5000

test:
test: &test
adapter: sqlite3
database: db/db_test
timeout: 5000
Expand All @@ -12,3 +12,6 @@ production:
adapter: postgresql
database: db_production
timeout: 5000

cucumber:
<<: *test
Binary file added db/db_development
Binary file not shown.
Binary file added db/db_test
Binary file not shown.
26 changes: 26 additions & 0 deletions features/auth.feature
@@ -0,0 +1,26 @@
Feature: A non_admin can not merge articles

As a admin
I should be able to merge articles with same topic from different authors
so I can preserve both authors' content

Background: articles in database



Scenario: user should be admin




Scenario: admin is able to merge articles





Scenario: user is not admin(sad path)



Scenario: user should not be able to merge articles(sad path)
9 changes: 9 additions & 0 deletions features/authors.feature
@@ -0,0 +1,9 @@
Feature: When articles are merged, the merged article should have multiple authors(the authors of the original article)

As a admin
I want to merge articles
So that merged article should have multiple authors

Background: articles in database

Scenario: the merged article should have multiple authors
9 changes: 9 additions & 0 deletions features/comment.feature
@@ -0,0 +1,9 @@
Feature: comments on each of the two original articles need to all carry over and point to the new, merged article

As a user
I should be able to read both articles' comments appear in the merged article
so I could read comments
Background: articles in database and comments in articles


Scenario: I should see both articles'comments appear in the merged article
9 changes: 9 additions & 0 deletions features/edit.feature
@@ -0,0 +1,9 @@
Feature: When articles are merged, any of the authors of the original articles should be able to make edits to the merged article

As a author
I want to edit the merged article
So that merged article is changed

Background: articles in database

Scenario:
13 changes: 13 additions & 0 deletions features/permalinks.feature
@@ -0,0 +1,13 @@
Feature: When mergeing two articles (and thus deleting at least one of them), the permalinks to the original articles should point to the merged article

As a user
I should be able to go to the merged article when click on the permalinks
so I could read the merged article

Background: articles in database



Scenario: one of the articles should be deleted
Scenario: permalink of the remaining article should points to itself
Scenario: permalink of the deleted article should points to the merged article

0 comments on commit 4671894

Please sign in to comment.