Commit a998cab1 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'cs-fix-group-analytics' into 'master'

Fix Contribution Analytics and move test to RSpec.

Apparently Spinach tests don't fail when there are JS errors, which is
why this didn't get caught earlier. Changing the test to RSpec should
future-proof it.

Fixes #871.

See merge request !633
parents e6b37448 2705bdea
- page_title "Contribution Analytics"
- header_title group_title(@group, "Contribution Analytics", group_analytics_path(@group))
- content_for :page_specific_javascripts do
= page_specific_javascript_tag('lib/chart.js')
.gray-content-block
.sub-header-block
.pull-right
.dropdown.inline
%button.dropdown-toggle.btn{type: 'button', 'data-toggle' => 'dropdown'}
= icon('calendar-o')
%b.caret
%ul.dropdown-menu
%ul.dropdown-menu.dropdown-menu-align-right
%li
= link_to group_analytics_path(@group, start_date: Date.today - 1.week) do
Last week
......
Feature: Group Analytics
Background:
Given I sign in as "John Doe"
And "John Doe" is owner of group "Owned"
Scenario: I should see group "Owned" analytics page
When I visit group "Owned" page
And I click on group analytics
Then I should see group analytics page
class Spinach::Features::GroupAnalytics < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedGroup
include SharedUser
step 'I click on group analytics' do
click_link 'Contribution Analytics'
end
step 'I should see group analytics page' do
expect(page).to have_content "Contribution analytics for issues, merge requests and push"
end
end
require 'spec_helper'
feature 'Groups > Contribution Analytics', js: true, feature: true do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:empty_project) { create(:empty_project, namespace: group) }
before do
group.add_owner(user)
login_with(user)
end
describe 'visit Contribution Analytics page for group' do
it 'displays Contribution Analytics' do
visit group_path(group)
click_link 'Contribution Analytics'
expect(page).to have_content "Contribution analytics for issues, merge requests and push"
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment