Commit 65e88f1e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fixed few tests and improved css style

parent 8ecf7d32
...@@ -6,6 +6,7 @@ class @EditBlob ...@@ -6,6 +6,7 @@ class @EditBlob
ace_mode = mode ace_mode = mode
editor = ace.edit("editor") editor = ace.edit("editor")
editor.focus() editor.focus()
@editor = editor
if ace_mode if ace_mode
editor.getSession().setMode "ace/mode/" + ace_mode editor.getSession().setMode "ace/mode/" + ace_mode
...@@ -38,3 +39,6 @@ class @EditBlob ...@@ -38,3 +39,6 @@ class @EditBlob
currentPane.fadeIn 200 currentPane.fadeIn 200
editor.focus() editor.focus()
return return
editor: ->
return @editor
...@@ -6,6 +6,7 @@ class @NewBlob ...@@ -6,6 +6,7 @@ class @NewBlob
ace_mode = mode ace_mode = mode
editor = ace.edit("editor") editor = ace.edit("editor")
editor.focus() editor.focus()
@editor = editor
if ace_mode if ace_mode
editor.getSession().setMode "ace/mode/" + ace_mode editor.getSession().setMode "ace/mode/" + ace_mode
...@@ -15,3 +16,6 @@ class @NewBlob ...@@ -15,3 +16,6 @@ class @NewBlob
$("#file-content").val editor.getValue() $("#file-content").val editor.getValue()
$(".file-editor form").submit() $(".file-editor form").submit()
return return
editor: ->
return @editor
...@@ -35,15 +35,15 @@ ...@@ -35,15 +35,15 @@
.file-title { .file-title {
@extend .monospace; @extend .monospace;
font-size: 14px; font-size: 14px;
padding: 5px;
} }
.editor-ref { .editor-ref {
background: #fafafa; background: #f5f5f5;
padding: 18px 15px; padding: 11px 15px;
padding-left: 25px;
border-right: 1px solid #CCC; border-right: 1px solid #CCC;
display: inline-block; display: inline-block;
margin: -10px -15px; margin: -5px -5px;
margin-right: 10px; margin-right: 10px;
} }
......
...@@ -21,4 +21,4 @@ ...@@ -21,4 +21,4 @@
cancel_path: @after_edit_path cancel_path: @after_edit_path
:javascript :javascript
new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}") blob = new EditBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", "#{@blob.language.try(:ace_mode)}")
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
cancel_path: project_tree_path(@project, @id) cancel_path: project_tree_path(@project, @id)
:javascript :javascript
new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null) blob = new NewBlob(gon.relative_url_root + "#{Gitlab::Application.config.assets.prefix}", null)
...@@ -58,7 +58,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -58,7 +58,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I can edit code' do step 'I can edit code' do
set_new_content set_new_content
evaluate_script('editor.getValue()').should == new_gitignore_content evaluate_script('blob.editor.getValue()').should == new_gitignore_content
end end
step 'I edit code' do step 'I edit code' do
...@@ -103,7 +103,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -103,7 +103,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I can see new file page' do step 'I can see new file page' do
page.should have_content "New file" page.should have_content "New file"
page.should have_content "File name"
page.should have_content "Commit message" page.should have_content "Commit message"
end end
...@@ -170,7 +169,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps ...@@ -170,7 +169,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
private private
def set_new_content def set_new_content
execute_script("editor.setValue('#{new_gitignore_content}')") execute_script("blob.editor.setValue('#{new_gitignore_content}')")
end end
# Content of the gitignore file on the seed repository. # Content of the gitignore file on the seed repository.
......
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