diff options
Diffstat (limited to 'spec/features/projects/show')
-rw-r--r-- | spec/features/projects/show/user_interacts_with_stars_spec.rb | 12 | ||||
-rw-r--r-- | spec/features/projects/show/user_sees_collaboration_links_spec.rb | 6 |
2 files changed, 15 insertions, 3 deletions
diff --git a/spec/features/projects/show/user_interacts_with_stars_spec.rb b/spec/features/projects/show/user_interacts_with_stars_spec.rb index e0dd4f65010..158b6aa9b46 100644 --- a/spec/features/projects/show/user_interacts_with_stars_spec.rb +++ b/spec/features/projects/show/user_interacts_with_stars_spec.rb @@ -13,6 +13,14 @@ RSpec.describe 'Projects > Show > User interacts with project stars' do visit(project_path(project)) end + it 'retains the star count even after a page reload' do + star_project + + reload_page + + expect(page).to have_css('.star-count', text: 1) + end + it 'toggles the star' do star_project @@ -63,6 +71,10 @@ end private +def reload_page + visit current_path +end + def star_project click_button(_('Star')) wait_for_requests diff --git a/spec/features/projects/show/user_sees_collaboration_links_spec.rb b/spec/features/projects/show/user_sees_collaboration_links_spec.rb index 1440db141a6..c63427e56e6 100644 --- a/spec/features/projects/show/user_sees_collaboration_links_spec.rb +++ b/spec/features/projects/show/user_sees_collaboration_links_spec.rb @@ -5,8 +5,8 @@ require 'spec_helper' RSpec.describe 'Projects > Show > Collaboration links', :js do using RSpec::Parameterized::TableSyntax - let(:project) { create(:project, :repository, :public) } - let(:user) { create(:user) } + let_it_be(:project) { create(:project, :repository, :public) } + let_it_be(:user) { create(:user) } before do sign_in(user) @@ -17,7 +17,7 @@ RSpec.describe 'Projects > Show > Collaboration links', :js do end context 'with developer user' do - before do + before_all do project.add_developer(user) end |