mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 16:20:12 +01:00
fix #1396 and add a test for it
This commit is contained in:
parent
28bfbe6f1d
commit
fe31eb75a5
3 changed files with 28 additions and 3 deletions
|
|
@ -9,7 +9,11 @@
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
function hide_empty_message() {
|
function hide_empty_message() {
|
||||||
$('contexts-empty-nd').hide();
|
<% if @context.hidden? -%>
|
||||||
|
$('div#hidden-contexts-empty-nd').hide();
|
||||||
|
<% else -%>
|
||||||
|
$('div#active-contexts-empty-nd').hide();
|
||||||
|
<% end -%>
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_context(state) {
|
function add_context(state) {
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ Feature: Manage the list of contexts
|
||||||
And the badge should show 1
|
And the badge should show 1
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario Outline: Add a new context with state
|
Scenario Outline: Showing a new context with state
|
||||||
Given I have the following contexts
|
Given I have the following contexts
|
||||||
| context | hide |
|
| context | hide |
|
||||||
| @ipad | true |
|
| @ipad | true |
|
||||||
|
|
@ -97,6 +97,18 @@ Feature: Manage the list of contexts
|
||||||
| active | @phone |
|
| active | @phone |
|
||||||
| hidden | @hidden |
|
| hidden | @hidden |
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: Showing a new context with state
|
||||||
|
When I go to the contexts page
|
||||||
|
Then I should see empty message for active contexts
|
||||||
|
And I should see empty message for hidden contexts
|
||||||
|
When I add a new active context "@active"
|
||||||
|
Then I should see the context "@active" under "active"
|
||||||
|
And I should not see empty message for active contexts
|
||||||
|
When I add a new hidden context "@hidden"
|
||||||
|
Then I should see the context "@hidden" under "hidden"
|
||||||
|
And I should not see empty message for hidden contexts
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: I can drag and drop to order the contexts
|
Scenario: I can drag and drop to order the contexts
|
||||||
Given I have the following contexts
|
Given I have the following contexts
|
||||||
|
|
|
||||||
|
|
@ -90,3 +90,12 @@ end
|
||||||
Then /^the context list badge for ([^"]*) contexts should show (\d+)$/ do |state_name, count|
|
Then /^the context list badge for ([^"]*) contexts should show (\d+)$/ do |state_name, count|
|
||||||
find("span##{state_name}-contexts-count").text.should == count
|
find("span##{state_name}-contexts-count").text.should == count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Then /^I should (see|not see) empty message for (active|hidden) contexts$/ do |visible, state|
|
||||||
|
box = (state=='active') ? "div#active-contexts-empty-nd" : "div#hidden-contexts-empty-nd"
|
||||||
|
|
||||||
|
elem = page.find(box)
|
||||||
|
elem.should_not be_nil
|
||||||
|
|
||||||
|
elem.send(visible=="see" ? "should" : "should_not", be_visible)
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue