diff --git a/app/assets/javascripts/project_show.js.coffee b/app/assets/javascripts/project_show.js.coffee index cb47062842ed906eca60125766122ea7e810f5a3..1fdf28f25281a18a5acaf1b7779c50bc08bd75aa 100644 --- a/app/assets/javascripts/project_show.js.coffee +++ b/app/assets/javascripts/project_show.js.coffee @@ -1,10 +1,3 @@ class @ProjectShow constructor: -> - $("a[data-toggle='tab']").on "shown.bs.tab", (e) -> - $.cookie "default_view", $(e.target).attr("href"), { expires: 30, path: '/' } - - defaultView = $.cookie("default_view") - if defaultView - $("a[href=" + defaultView + "]").tab "show" - else - $("a[data-toggle='tab']:first").tab "show" + # I kept class for future diff --git a/app/views/projects/buttons/_star.html.haml b/app/views/projects/buttons/_star.html.haml index 89e3f4ac73847093915f40e284ded0730ac034ad..664ebd182958542a6e1645d0e66ca53d9378d78b 100644 --- a/app/views/projects/buttons/_star.html.haml +++ b/app/views/projects/buttons/_star.html.haml @@ -1,22 +1,21 @@ - if current_user - = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn toggle-star', method: :post, remote: true do + = link_to toggle_star_namespace_project_path(@project.namespace, @project), class: 'btn star-btn toggle-star', method: :post, remote: true do - if current_user.starred?(@project) Unstar - else Star %span.count = @project.star_count + + :coffeescript + $('.project-home-panel .toggle-star').on 'ajax:success', (e, data, status, xhr) -> + $(@).replaceWith(data.html) + .on 'ajax:error', (e, xhr, status, error) -> + new Flash('Star toggle failed. Try again later.', 'alert') + - else - = link_to new_user_session_path, class: 'btn has_tooltip', title: 'You must sign in to star a project' do + = link_to new_user_session_path, class: 'btn has_tooltip star-btn', title: 'You must sign in to star a project' do = icon('star') Star %span.count = @project.star_count - -:coffeescript - $('.project-home-panel .toggle-star').on 'ajax:success', (e, data, status, xhr) -> - $(@).replaceWith(data.html) - .on 'ajax:error', (e, xhr, status, error) -> - new Flash('Star toggle failed. Try again later.', 'alert') - - diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index 8fb5f25c2f62d1031a92e47cc14434f041638a82..17907a42e3c0891a56607cd95dd2920e93e844c7 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -51,7 +51,7 @@ = render_readme(readme) - else %h3.page-title - This project does not have README yet :( + This project does not have README yet - if can?(current_user, :push_code, @project) %p.slead A diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature index a15298fc452d57423fa22ec02d0decfb8a10e460..28cc43ef710110a152319be8b1be6c65959dd1ff 100644 --- a/features/project/issues/issues.feature +++ b/features/project/issues/issues.feature @@ -189,6 +189,7 @@ Feature: Project Issues Given I logout Given public project "Community" When I visit project "Community" page + And I visit project "Community" issues page And I click link "New Issue" And I should not see assignee field And I should not see milestone field diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature index 9567b57112034b7659b1407ee15d791181607c39..2369c02806f079f87bc599a08795746eec3581b6 100644 --- a/features/project/shortcuts.feature +++ b/features/project/shortcuts.feature @@ -53,6 +53,5 @@ Feature: Project Shortcuts @javascript Scenario: Navigate to project feed - Given I visit my project's files page Given I press "g" and "e" Then the active main tab should be Activity diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 9ace6436b158df3679b35cacd664db9698949dad..239392eab9673ad7ad4de86d4038de16684acbde 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -194,6 +194,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end end + When "I visit project \"Community\" issues page" do + project = Project.find_by(name: 'Community') + visit namespace_project_issues_path(project.namespace, project) + end + When "I visit empty project's issues page" do project = Project.find_by(name: 'Empty Project') visit namespace_project_issues_path(project.namespace, project) diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb index 8b50bfcef04b40976342badc0aaee1b41f3fb2f6..bd2e0619cddd8be94d6717fec3d268a41313cc14 100644 --- a/features/steps/project/star.rb +++ b/features/steps/project/star.rb @@ -5,7 +5,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps include SharedUser step "The project has no stars" do - expect(page).not_to have_content '.star-buttons' + expect(page).not_to have_content '.toggle-star' end step "The project has 0 stars" do diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index 3b94b7d862103eb59e7cf79598e388fe17e5155c..c67e5e4a06a890d5acbac404b4e0db3db09e7dd1 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -49,4 +49,8 @@ module SharedProjectTab expect(page).to have_content('Back to project') end end + + step 'the active main tab should be Activity' do + ensure_active_main_tab('Activity') + end end