@@ -131,6 +131,32 @@ def find_tag_checkbox(name)
131131 expect ( info ) . not_to have_content ( "You are a contributor in this repository" )
132132 end
133133
134+ context "when user_permission.push_images is disabled" do
135+ before do
136+ APP_CONFIG [ "user_permission" ] [ "push_images" ] [ "enabled" ] = false
137+ end
138+
139+ it "Visual aid for each role is shown properly" do
140+ login_as user
141+ visit repository_path ( repository )
142+ info = page . find ( ".repository-information-icon" ) [ "data-content" ]
143+ expect ( info ) . to have_content ( "You can push images" )
144+ expect ( info ) . to have_content ( "You can pull images" )
145+ expect ( info ) . to have_content ( "You are an owner of this repository" )
146+ expect ( info ) . not_to have_content ( "You are a contributor in this repository" )
147+ expect ( info ) . not_to have_content ( "You are a viewer in this repository" )
148+
149+ login_as user2 , scope : :user
150+ visit repository_path ( repository )
151+ info = page . find ( ".repository-information-icon" ) [ "data-content" ]
152+ expect ( info ) . not_to have_content ( "You can push images" )
153+ expect ( info ) . to have_content ( "You can pull images" )
154+ expect ( info ) . not_to have_content ( "You are an owner of this repository" )
155+ expect ( info ) . to have_content ( "You are a contributor in this repository" )
156+ expect ( info ) . not_to have_content ( "You are a viewer in this repository" )
157+ end
158+ end
159+
134160 it "A user can star a repository" , js : true do
135161 visit repository_path ( repository )
136162 expect ( page ) . to have_css ( "#toggle_star" )
0 commit comments