trigger('scroll');
});
}).
+ on('shown.bs.tab', 'a[data-toggle="tab"]', function(event) {
+ $(event.target.getAttribute('href') + ' [data-infinite-scroller]').
+ trigger('scroll');
+ }).
on('click', 'th[data-sort-order]', function() {
var direction = $(this).data('sort-order-direction');
// reverse the current direction, or do ascending if none
assert match, 'Expected project name not found'
assert_text 'No description provided'
end
+
+ test "first tab loads data when visiting other tab directly" do
+ # As of 2014-12-19, the first tab of project#show uses infinite scrolling.
+ # Make sure that it loads data even if we visit another tab directly.
+ project = api_fixture("groups", "aproject")
+ visit(page_with_token("active_trustedclient",
+ "/projects/#{project['uuid']}#Advanced"))
+ assert_text("API response")
+ find("#page-wrapper .nav-tabs :first-child a").click
+ assert_text("bytes Collection")
+ end
end
# fixture, or passed as a raw string.
api_token = ((@@API_AUTHS.include? token) ?
@@API_AUTHS[token]['api_token'] : token)
- sep = (path.include? '?') ? '&' : '?'
+ path_parts = path.partition("#")
+ sep = (path_parts.first.include? '?') ? '&' : '?'
q_string = URI.encode_www_form('api_token' => api_token)
- "#{path}#{sep}#{q_string}"
+ path_parts.insert(1, "#{sep}#{q_string}")
+ path_parts.join("")
end
# Find a page element, but return false instead of raising an