Skip to content
Snippets Groups Projects
Commit 1ab1526d authored by Valery Sizov's avatar Valery Sizov
Browse files

Fix raw view for public snippets

parent a2dfff41
Branches
Tags
No related merge requests found
Loading
@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
Loading
@@ -9,7 +9,7 @@ class SnippetsController < ApplicationController
   
before_filter :set_title before_filter :set_title
   
skip_before_filter :authenticate_user!, only: [:index, :user_index, :show] skip_before_filter :authenticate_user!, only: [:index, :user_index, :show, :raw]
   
respond_to :html respond_to :html
   
Loading
Loading
Loading
@@ -3,3 +3,8 @@ Feature: Public snippets
Loading
@@ -3,3 +3,8 @@ Feature: Public snippets
Given There is public "Personal snippet one" snippet Given There is public "Personal snippet one" snippet
And I visit snippet page "Personal snippet one" And I visit snippet page "Personal snippet one"
Then I should see snippet "Personal snippet one" Then I should see snippet "Personal snippet one"
Scenario: Unauthenticated user should see raw public snippets
Given There is public "Personal snippet one" snippet
And I visit snippet raw page "Personal snippet one"
Then I should see raw snippet "Personal snippet one"
Loading
@@ -7,10 +7,18 @@ class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
Loading
@@ -7,10 +7,18 @@ class Spinach::Features::PublicSnippets < Spinach::FeatureSteps
page.should have_no_xpath("//i[@class='public-snippet']") page.should have_no_xpath("//i[@class='public-snippet']")
end end
   
step 'I should see raw snippet "Personal snippet one"' do
page.should have_text(snippet.content)
end
step 'I visit snippet page "Personal snippet one"' do step 'I visit snippet page "Personal snippet one"' do
visit snippet_path(snippet) visit snippet_path(snippet)
end end
   
step 'I visit snippet raw page "Personal snippet one"' do
visit raw_snippet_path(snippet)
end
def snippet def snippet
@snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one")
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment