Then page should not have content not cotaining "v2.1.0"
When click "Show only selected branch" checkbox
Then page should have content not cotaining "v2.1.0"
+
+ Scenario: I should fail to look for a commit
+ When I look for a commit by ";"
+ Then page status code should be 404
# Automatically renders `not_found!` if a valid tree path could not be
# resolved (e.g., when a user inserts an invalid path or ref).
def assign_ref_vars
+ # assign allowed options
+ allowed_options = ["filter_ref", "q"]
+ @options = params.select {|key, value| allowed_options.include?(key) && !value.blank? }
+ @options = HashWithIndifferentAccess.new(@options)
+
@id = get_id
@ref, @path = extract_ref(@id)
@repo = @project.repository
- @commit = @repo.commit(@ref)
+ if @options[:q].blank?
+ @commit = @repo.commit(@ref)
+ else
+ @commit = @repo.commit(@options[:q])
+ end
@tree = Tree.new(@repo, @commit.id, @ref, @path)
@hex_path = Digest::SHA1.hexdigest(@path)
@logs_path = logs_file_project_ref_path(@project, @ref, @path)
- # assign allowed options
- allowed_options = ["filter_ref", "q"]
- @options = params.select {|key, value| allowed_options.include?(key) && !value.blank? }
- @options = HashWithIndifferentAccess.new(@options)
-
raise InvalidPathError unless @tree.exists?
rescue RuntimeError, NoMethodError, InvalidPathError
not_found!