Skip to content

Commit 3aee0d1

Browse files
committed
Merge pull request riseuplabs#91 from azul/test/fix-pending-ajax
deal with edit being the default tab for empty wikis
2 parents f29e846 + 1c6350a commit 3aee0d1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test/helpers/integration/navigation.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
module Integration
22
module Navigation
33

4+
def select_page_tab(tab)
5+
return if find('#page_tabs li.tab.active').has_content?(tab)
6+
click_page_tab(tab)
7+
assert_page_tab(tab)
8+
end
9+
410
def click_page_tab(tab)
511
find('#page_tabs').click_on(tab)
612
end

test/helpers/integration/wiki.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ module Integration
22
module Wiki
33
def update_wiki(content = nil)
44
# work around not being on edit to begin with
5-
click_page_tab 'Edit'
6-
# ensure the edit page is loaded
7-
find('li.active a.active', text: 'Edit')
5+
select_page_tab 'Edit'
86
content ||= Faker::Lorem.paragraphs(4).join("\n")
97
within('form.edit_wiki') do
108
fill_in 'wiki[body]', with: content

0 commit comments

Comments
 (0)