mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-26 10:46:10 +01:00
Move over another ajax test from selenium to stories.
This commit is contained in:
parent
6f760c768e
commit
adde38eecb
3 changed files with 82 additions and 5 deletions
15
stories/context_detail/change_context_name.story
Normal file
15
stories/context_detail/change_context_name.story
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Story: Change context name
|
||||
|
||||
As a Tracks user
|
||||
I want to change the name of a context
|
||||
So that it can best reflect my daily life
|
||||
|
||||
Scenario: In place edit of context name
|
||||
Given a logged in user Luis
|
||||
And Luis has a context Errands
|
||||
When Luis visits the Errands context page
|
||||
And he edits the Errands context name in place to be OutAndAbout
|
||||
Then he should see the context name is OutAndAbout
|
||||
When Luis visits the context listing page
|
||||
Then he should see that a context named Errands is not present
|
||||
And he should see that a context named OutAndAbout is present
|
||||
34
stories/steps/context_detail.rb
Normal file
34
stories/steps/context_detail.rb
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
steps_for :context_detail do
|
||||
include_steps_for :users
|
||||
|
||||
Given "Luis has a context Errands" do
|
||||
@errands = @luis.contexts.create!(:name => 'Errands')
|
||||
end
|
||||
|
||||
When "Luis visits the Errands context page" do
|
||||
visits "/contexts/#{@errands.to_param}"
|
||||
end
|
||||
|
||||
When "he edits the Errands context name in place to be OutAndAbout" do
|
||||
selenium.click 'context_name_in_place_editor'
|
||||
wait_for_ajax_and_effects
|
||||
selenium.type "css=#context_name_in_place_editor-inplaceeditor input.editor_field", "OutAndAbout"
|
||||
clicks_button "ok", :wait => :ajax
|
||||
end
|
||||
|
||||
When "Luis visits the context listing page" do
|
||||
visits "/contexts"
|
||||
end
|
||||
|
||||
Then "he should see the context name is OutAndAbout" do
|
||||
should_see 'OutAndAbout'
|
||||
end
|
||||
|
||||
Then "he should see that a context named Errands is not present" do
|
||||
should_not_see 'Errands'
|
||||
end
|
||||
|
||||
Then "he should see that a context named OutAndAbout is present" do
|
||||
should_see 'OutAndAbout'
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue