diff --git a/app/assets/javascripts/blob.js b/app/assets/javascripts/blob.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/blob.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js new file mode 100644 index 000000000..dee720fac --- /dev/null +++ b/app/assets/javascripts/projects.js @@ -0,0 +1,2 @@ +// Place all the behaviors and hooks related to the matching controller here. +// All this logic will automatically be available in application.js. diff --git a/app/assets/stylesheets/blob.scss b/app/assets/stylesheets/blob.scss new file mode 100644 index 000000000..d0d4a71e3 --- /dev/null +++ b/app/assets/stylesheets/blob.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the blob controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/projects.scss b/app/assets/stylesheets/projects.scss new file mode 100644 index 000000000..d01926666 --- /dev/null +++ b/app/assets/stylesheets/projects.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the projects controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/blob_controller.rb b/app/controllers/blob_controller.rb new file mode 100644 index 000000000..bba1efb5f --- /dev/null +++ b/app/controllers/blob_controller.rb @@ -0,0 +1,12 @@ +class BlobController < ApplicationController + def new + commit unless @repository.empty? + end + + def create + create_commit(Files::CreateService, success_path: after_create_path, + failure_view: :new, + failure_path: namespace_project_new_blob_path(@project.namespace, @project, @ref)) + end + +end diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb new file mode 100644 index 000000000..101bebb87 --- /dev/null +++ b/app/helpers/blob_helper.rb @@ -0,0 +1,2 @@ +module BlobHelper +end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb new file mode 100644 index 000000000..db5c5ce1a --- /dev/null +++ b/app/helpers/projects_helper.rb @@ -0,0 +1,2 @@ +module ProjectsHelper +end diff --git a/spec/controllers/blob_controller_spec.rb b/spec/controllers/blob_controller_spec.rb new file mode 100644 index 000000000..84b256459 --- /dev/null +++ b/spec/controllers/blob_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe BlobController, type: :controller do + +end diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb new file mode 100644 index 000000000..397b7480b --- /dev/null +++ b/spec/controllers/projects_controller_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe ProjectsController, type: :controller do + +end diff --git a/spec/helpers/blob_helper_spec.rb b/spec/helpers/blob_helper_spec.rb new file mode 100644 index 000000000..ba4e6987a --- /dev/null +++ b/spec/helpers/blob_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the BlobHelper. For example: +# +# describe BlobHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe BlobHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/helpers/projects_helper_spec.rb b/spec/helpers/projects_helper_spec.rb new file mode 100644 index 000000000..fee7ccc2c --- /dev/null +++ b/spec/helpers/projects_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the ProjectsHelper. For example: +# +# describe ProjectsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe ProjectsHelper, type: :helper do + pending "add some examples to (or delete) #{__FILE__}" +end