From 43afe46bbd19b1edf60abf3f104fb2b0d29af564 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 22 Mar 2015 13:55:00 -0700 Subject: Refactor contributions events and write tests for calendar --- features/steps/user.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'features/steps') diff --git a/features/steps/user.rb b/features/steps/user.rb index d6f05ecb2c7..e6086bfc1c9 100644 --- a/features/steps/user.rb +++ b/features/steps/user.rb @@ -7,4 +7,39 @@ class Spinach::Features::User < Spinach::FeatureSteps step 'I should see user "John Doe" page' do expect(title).to match(/^\s*John Doe/) end + + step '"John Doe" has contributions' do + user = User.find_by(name: 'John Doe') + project = contributed_project + + # Issue controbution + issue_params = { title: 'Bug in old browser' } + Issues::CreateService.new(project, user, issue_params).execute + + # Push code contribution + push_params = { + project: project, + action: Event::PUSHED, + author_id: user.id, + data: { commit_count: 3 } + } + + Event.create(push_params) + end + + step 'I should see contributed projects' do + within '.contributed-projects' do + page.should have_content(@contributed_project.name) + end + end + + step 'I should see contributions calendar' do + within '.calendar' do + page.should have_css('.graph-rect.r2.q2') + end + end + + def contributed_project + @contributed_project ||= create(:project, :public) + end end -- cgit v1.2.1 From 54aca18cf856a18bdd121a3db25d2a64b9e0844d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 22 Mar 2015 14:35:27 -0700 Subject: Contribution calendar will use events instead of commits to count contributions --- features/steps/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'features/steps') diff --git a/features/steps/user.rb b/features/steps/user.rb index e6086bfc1c9..5939c28a000 100644 --- a/features/steps/user.rb +++ b/features/steps/user.rb @@ -35,7 +35,7 @@ class Spinach::Features::User < Spinach::FeatureSteps step 'I should see contributions calendar' do within '.calendar' do - page.should have_css('.graph-rect.r2.q2') + page.should have_css('.graph-rect.r3.q3') end end -- cgit v1.2.1 From b449bc5b77aa658db67ebcb25f709fe51c29b129 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 22 Mar 2015 19:47:23 -0700 Subject: Improve user calendar test --- features/steps/user.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'features/steps') diff --git a/features/steps/user.rb b/features/steps/user.rb index 5939c28a000..10cae692a88 100644 --- a/features/steps/user.rb +++ b/features/steps/user.rb @@ -34,9 +34,7 @@ class Spinach::Features::User < Spinach::FeatureSteps end step 'I should see contributions calendar' do - within '.calendar' do - page.should have_css('.graph-rect.r3.q3') - end + page.should have_css('.cal-heatmap-container') end def contributed_project -- cgit v1.2.1 From a3daead1b00c28a16684cf11970ebd6da27511e2 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 23 Mar 2015 05:51:38 -0700 Subject: Include missing events and fix save functionality in admin service template settings form Closes #1275 --- features/steps/admin/settings.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'features/steps') diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb index c2d0d2a3fa3..87d4e969ff5 100644 --- a/features/steps/admin/settings.rb +++ b/features/steps/admin/settings.rb @@ -15,4 +15,33 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps current_application_settings.home_page_url.should == 'https://about.gitlab.com/' page.should have_content 'Application settings saved successfully' end + + step 'I click on "Service Templates"' do + click_link 'Service Templates' + end + + step 'I click on "Slack" service' do + click_link 'Slack' + end + + step 'I check all events and submit form' do + page.check('Active') + page.check('Push events') + page.check('Tag push events') + page.check('Comments') + page.check('Issues events') + page.check('Merge Request events') + fill_in 'Webhook', with: "http://localhost" + click_on 'Save' + end + + step 'I should see service template settings saved' do + page.should have_content 'Application settings saved successfully' + end + + step 'I should see all checkboxes checked' do + all('input[type=checkbox]').each do |checkbox| + checkbox.should be_checked + end + end end -- cgit v1.2.1