Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View item, create corpus & delete corpus #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions spec/features/create_corpus.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require 'spec_helper'

feature 'Corpus' do

$corpus = a_string()
$user = 'alice'
$pass = 'lapinblanc'

scenario 'do create' do
visit '/'
click_on 'Se connecter'
log_in_as $user, $pass
toggle_edit
click_plus_sign_next_to 'corpus'
click_last 'corpus'
type $corpus, :return
expect(page).to have_content($corpus)
toggle_edit
end

scenario 'do delete' do
visit '/'
click_on 'Se connecter'
log_in_as $user, $pass
toggle_edit
click_del_sign_before $corpus, 'corpus'
expect(page).to have_content($corpus)
toggle_edit
end

end
16 changes: 16 additions & 0 deletions spec/features/view_item.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

feature 'View Item' do
scenario 'search by topic' do
visit '/'
click_on 'Rechercher par thème'
in_dialog.click_on 'Nuage'
in_dialog.click_on 'B1. Conception et développement d\'applications'
in_dialog.click_on 'Sélectionner'
visit '/argos/viewpoint/A0A0A0A50Z0SD5S4DSDSDS'
expect(page).to have_content 'B1. Conception et développement'
click_on 'LO10 – Approches orientées services (UV)'
visit '/argos/item/A0A0A0A50Z0SD5S4DSDSDS/A0A0A0A50Z0SD5S4DSDSDS'
end

end
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Capybara.run_server = false
Capybara.default_driver = :poltergeist
Capybara.app_host = "http://agorae.test.hypertopic.org"
Capybara.default_selector = :xpath

$home_page = '/'

Expand All @@ -26,6 +27,10 @@ def click_plus_sign_next_to(list)
find(".#{list}-list .add").click
end

def click_del_sign_before(item, list)
find('span', :text => "#{text}").find(:xpath, "..").find('.del').click
end

def click_last(list)
find("##{list} li:last-child .editable").click
end
Expand Down