Skip to content

Commit ac8b263

Browse files
committed
Adding cucumber support to typo
1 parent 8361429 commit ac8b263

File tree

13 files changed

+584
-9
lines changed

13 files changed

+584
-9
lines changed

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,9 @@ group :development, :test do
5050
gem 'rspec-rails', '~> 2.0'
5151
gem 'simplecov', :require => false
5252
gem 'sqlite3'
53+
gem 'cucumber'
54+
gem 'cucumber-rails'
55+
gem 'cucumber-rails-training-wheels'
56+
gem 'database_cleaner'
57+
gem 'capybara'
5358
end

Gemfile.lock

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,50 @@ GEM
3636
arel (2.0.10)
3737
bluecloth (2.2.0)
3838
builder (2.1.2)
39+
capybara (1.1.2)
40+
mime-types (>= 1.16)
41+
nokogiri (>= 1.3.3)
42+
rack (>= 1.0.0)
43+
rack-test (>= 0.5.4)
44+
selenium-webdriver (~> 2.0)
45+
xpath (~> 0.1.4)
46+
childprocess (0.3.2)
47+
ffi (~> 1.0.6)
3948
coderay (0.9.8)
4049
columnize (0.3.6)
50+
cucumber (1.1.9)
51+
builder (>= 2.1.2)
52+
diff-lcs (>= 1.1.2)
53+
gherkin (~> 2.9.0)
54+
json (>= 1.4.6)
55+
term-ansicolor (>= 1.0.6)
56+
cucumber-rails (1.3.0)
57+
capybara (>= 1.1.2)
58+
cucumber (>= 1.1.8)
59+
nokogiri (>= 1.5.0)
60+
cucumber-rails-training-wheels (1.0.0)
61+
cucumber-rails (>= 1.1.1)
62+
database_cleaner (0.7.2)
4163
diff-lcs (1.1.3)
4264
erubis (2.6.6)
4365
abstract (>= 1.0.0)
4466
factory_girl (2.2.0)
4567
activesupport
68+
ffi (1.0.11)
4669
flickraw (0.9.5)
4770
flickraw-cached (20110920)
4871
flickraw (>= 0.9)
72+
gherkin (2.9.3)
73+
json (>= 1.4.6)
4974
htmlentities (4.3.1)
5075
i18n (0.5.0)
5176
json (1.6.5)
5277
kaminari (0.13.0)
5378
actionpack (>= 3.0.0)
5479
activesupport (>= 3.0.0)
5580
railties (>= 3.0.0)
81+
libwebsocket (0.1.3)
82+
addressable
5683
linecache19 (0.5.12)
5784
ruby_core_source (>= 0.1.4)
5885
mail (2.2.19)
@@ -115,12 +142,20 @@ GEM
115142
ruby_core_source (0.1.5)
116143
archive-tar-minitar (>= 0.5.2)
117144
rubypants (0.2.0)
145+
rubyzip (0.9.7)
146+
selenium-webdriver (2.21.2)
147+
childprocess (>= 0.2.5)
148+
ffi (~> 1.0)
149+
libwebsocket (~> 0.1.3)
150+
multi_json (~> 1.0)
151+
rubyzip
118152
simplecov (0.6.1)
119153
multi_json (~> 1.0)
120154
simplecov-html (~> 0.5.3)
121155
simplecov-html (0.5.3)
122156
sqlite3 (1.3.5)
123157
subexec (0.0.4)
158+
term-ansicolor (1.0.7)
124159
thor (0.14.6)
125160
treetop (1.4.10)
126161
polyglot
@@ -131,6 +166,8 @@ GEM
131166
nokogiri (>= 1.2.0)
132167
rack (>= 1.0)
133168
rack-test (>= 0.5.3)
169+
xpath (0.1.4)
170+
nokogiri (~> 1.3)
134171

135172
PLATFORMS
136173
ruby
@@ -139,21 +176,26 @@ DEPENDENCIES
139176
RedCloth (~> 4.2.8)
140177
acts_as_list
141178
acts_as_tree_rails3
142-
addressable (~> 2.1.0)
143-
bluecloth (>= 2.0.5)
179+
addressable (~> 2.1)
180+
bluecloth (~> 2.1)
181+
capybara
144182
coderay (~> 0.9)
145-
factory_girl (= 2.2.0)
183+
cucumber
184+
cucumber-rails
185+
cucumber-rails-training-wheels
186+
database_cleaner
187+
factory_girl (~> 2.2)
146188
flickraw-cached
147189
htmlentities
148190
json
149191
kaminari
150-
mini_magick (= 1.3.3)
192+
mini_magick (~> 1.3.3)
151193
pg
152-
rails (= 3.0.10)
153-
rake (>= 0.9.2)
194+
rails (~> 3.0.10)
195+
rake (~> 0.9.2)
154196
recaptcha
155197
require_relative
156-
rspec-rails (>= 2.0.0.beta.20)
198+
rspec-rails (~> 2.0)
157199
ruby-debug19
158200
rubypants (~> 0.2.0)
159201
simplecov

config/cucumber.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<%
2+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
3+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
4+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip"
5+
%>
6+
default: <%= std_opts %> features
7+
wip: --tags @wip:3 --wip features
8+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip

config/database.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ development:
33
database: db/db_development
44
timeout: 5000
55

6-
test:
6+
test: &test
77
adapter: sqlite3
88
database: db/db_test
99
timeout: 5000
@@ -12,3 +12,6 @@ production:
1212
adapter: postgresql
1313
database: db_production
1414
timeout: 5000
15+
16+
cucumber:
17+
<<: *test

config/environments/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# test suite. You never need to work with it otherwise. Remember that
66
# your test database is "scratch space" for the test suite and is wiped
77
# and recreated between test runs. Don't rely on the data there!
8-
config.cache_classes = false
8+
config.cache_classes = true
99

1010
# Log error messages when you accidentally call methods on nil.
1111
config.whiny_nils = true

db/seeds.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,40 @@
55
#
66
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
77
# Mayor.create(:name => 'Daley', :city => cities.first)
8+
Blog.create(:id => 1, :settings => {"canonical_server_url"=>""})
9+
Category.create(:id => 1, :name => "General", :permalink => "general", :position => 1)
10+
Content.create(:allow_comments => true, :allow_pings => true, :author => "Mr Typo", :body => "Welcome to Typo. This is your first article. Edit or delete it, then start blogging!", :guid => "1bf3e2ca-ed7b-4562-8a4a-8ce8438822c8", :id => 1, :permalink => "hello-world", :post_type => "read", :published => true, :published_at => "2012-06-09 21:51:55 UTC", :settings => {"password"=>nil}, :state => "published", :text_filter_id => 5, :title => "Hello World!", :type => "Article", :user_id => 1)
11+
Content.create(:body => "This is an example of a Typo page. You can edit this to write information about yourself or your site so readers know who you are. You can create as many pages as this one as you like and manage all of your content inside Typo.", :id => 2, :name => "about", :post_type => "read", :published => true, :published_at => "2012-06-09 21:51:55 UTC", :settings => {"password"=>nil}, :state => "published", :text_filter_id => 5, :title => "about", :type => "Page", :user_id => 1)
12+
Profile.create(:id => 1, :label => "admin", :modules => [:dashboard, :articles, :pages, :media, :feedback, :themes, :sidebar, :users, :settings, :profile, :seo], :nicename => "Typo administrator")
13+
Profile.create(:id => 2, :label => "publisher", :modules => [:dashboard, :articles, :media, :pages, :feedback, :profile], :nicename => "Blog publisher")
14+
Profile.create(:id => 3, :label => "contributor", :modules => [:dashboard, :profile], :nicename => "Contributor")
15+
Right.create(:description => "Global administration", :id => 1, :name => "admin")
16+
Right.create(:description => "Create article", :id => 2, :name => "content_create")
17+
Right.create(:description => "Edit article", :id => 3, :name => "content_edit")
18+
Right.create(:description => "Delete article", :id => 4, :name => "content_delete")
19+
Right.create(:description => "Create a category", :id => 5, :name => "category_create")
20+
Right.create(:description => "Edit a category", :id => 6, :name => "category_edit")
21+
Right.create(:description => "Delete a category", :id => 7, :name => "category_delete")
22+
Right.create(:description => "Create a category", :id => 8, :name => "page_create")
23+
Right.create(:description => "Edit a category", :id => 9, :name => "page_edit")
24+
Right.create(:description => "Delete a category", :id => 10, :name => "page_delete")
25+
Right.create(:description => "Add a comment", :id => 11, :name => "feedback_create")
26+
Right.create(:description => "Edit self comments", :id => 12, :name => "feedback_self_edit")
27+
Right.create(:description => "Edit any comment", :id => 13, :name => "feedback_edit")
28+
Right.create(:description => "Delete self comments", :id => 14, :name => "feedback_self_delete")
29+
Right.create(:description => "Delete any comment", :id => 15, :name => "feedback_delete")
30+
Right.create(:description => "Create users", :id => 16, :name => "user_create")
31+
Right.create(:description => "Edit users", :id => 17, :name => "user_edit")
32+
Right.create(:description => "Edit self account", :id => 18, :name => "user_self_edit")
33+
Right.create(:description => "Delete users", :id => 19, :name => "user_delete")
34+
Sidebar.create(:active_position => 0, :config => {"maximum_pages"=>"10"}, :id => 1, :staged_position => 0, :type => "PageSidebar")
35+
Sidebar.create(:active_position => 1, :config => {"empty"=>false, "count"=>true}, :id => 2, :staged_position => 1, :type => "CategorySidebar")
36+
Sidebar.create(:active_position => 2, :config => {"show_count"=>true, "count"=>"10"}, :id => 3, :staged_position => 2, :type => "ArchivesSidebar")
37+
Sidebar.create(:active_position => 3, :config => {"body"=>"<ul>\n <li><a href=\"http://www.typosphere.org\" title=\"Typo\">Typosphere</a></li>\n <li><a href=\"http://typogarden.org\">Typogarden</a></li>\n <li><a href=\"http://t37.net\" title=\"Blog Exp\xC3\xA9rience utilisateur\">Fr\xC3\xA9d\xC3\xA9ric</a></li>\n <li><a href=\"http://www.matijs.net/\" title=\"Matijs\">Matijs</a></li>\n<li><a href=\"http://elsif.fr\" title=\"Yannick\">Yannick</a></li>\n<li><a href=\"http://blog.ookook.fr\" title=\"Thomas\">Thomas</a></li>\n<li><a href=\"http://blog.shingara.fr\" title=\"Cyril\">Cyril</a></li>\n\n\
38+
</ul>\n", "title"=>"Links"}, :id => 4, :staged_position => 3, :type => "StaticSidebar")
39+
Sidebar.create(:active_position => 4, :config => {"title"=>"Meta"}, :id => 5, :staged_position => 4, :type => "MetaSidebar")
40+
TextFilter.create(:description => "None", :filters => [], :id => 1, :markup => "none", :name => "none", :params => {})
41+
TextFilter.create(:description => "Markdown", :filters => [], :id => 2, :markup => "markdown", :name => "markdown", :params => {})
42+
TextFilter.create(:description => "SmartyPants", :filters => [:smartypants], :id => 3, :markup => "none", :name => "smartypants", :params => {})
43+
TextFilter.create(:description => "Markdown with SmartyPants", :filters => [:smartypants], :id => 4, :markup => "markdown", :name => "markdown smartypants", :params => {})
44+
TextFilter.create(:description => "Textile", :filters => [], :id => 5, :markup => "textile", :name => "textile", :params => {})

features/create_blog.feature

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Feature: Create Blog
2+
As an author
3+
In order to gift my thoughts to the world
4+
I want to create a blog
5+
6+
Scenario: Create blog page shown
7+
Given I am on the home page
8+
Then I should see "Welcome"
9+
And I should see "My Shiny Weblog!"

0 commit comments

Comments
 (0)