diff --git a/features/online_manual.feature b/features/online_manual.feature index 7116eea..a20405b 100644 --- a/features/online_manual.feature +++ b/features/online_manual.feature @@ -1,8 +1,12 @@ +@docs Feature: online manual As a user I want to read the manual So that I know how to do something in Noosfero + Background: + Given the documentation is built + Scenario: initial page of online manual When I go to /doc Then I should see "Noosfero online manual" diff --git a/features/step_definitions/documentation_steps.rb b/features/step_definitions/documentation_steps.rb new file mode 100644 index 0000000..ed99fe1 --- /dev/null +++ b/features/step_definitions/documentation_steps.rb @@ -0,0 +1,10 @@ +require File.join(Rails.root, 'test', 'noosfero_doc_test') +include Noosfero::DocTest + +Given 'the documentation is built' do + setup_doc_test +end + +After('@docs') do + tear_down_doc_test +end diff --git a/test/noosfero_doc_test.rb b/test/noosfero_doc_test.rb index 0daaf9d..53eb661 100644 --- a/test/noosfero_doc_test.rb +++ b/test/noosfero_doc_test.rb @@ -2,11 +2,12 @@ module Noosfero::DocTest ROOT = File.join(Rails.root, "test", "tmp", "doc") - def create_doc(section, topic, language, title) + def create_doc(section, topic, language, title, body = nil) dir = File.join(ROOT, section) FileUtils.mkdir_p(dir) File.open("#{dir}/#{topic}.#{language}.xhtml", "w") do |f| f.puts "

#{title}

" + f.puts body end end @@ -14,8 +15,8 @@ module Noosfero::DocTest FileUtils.mkdir_p(ROOT) # root - create_doc('', 'index', 'en', 'Root') - create_doc('', 'toc', 'en', 'Root') + create_doc('', 'index', 'en', 'Noosfero online manual') + create_doc('', 'toc', 'en', '', '') # cms create_doc('cms', 'index', 'en', 'Content Management') create_doc('cms', 'index', 'pt', 'Gerenciamento de conteúdo') @@ -28,10 +29,12 @@ module Noosfero::DocTest # user create_doc('user', 'index', 'en', 'User features') create_doc('user', 'index', 'pt', 'Funcionalidades de Usuário') - create_doc('user', 'toc', 'en', '') + create_doc('user', 'toc', 'en', '') create_doc('user', 'toc', 'pt', '') create_doc('user', 'accepting-friends', 'en', 'Accepting friends') create_doc('user', 'accepting-friends', 'pt', 'Aceitando amigos') + create_doc('user', 'commenting-articles', 'en', 'Commenting articles', 'How to access') + create_doc('user', 'commenting-articles', 'pt', 'Comentando artigos') DocSection.stubs(:root_dir).returns(ROOT) end -- libgit2 0.21.2