Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Show the contest submitter in ContestsController@show

  • Loading branch information...
commit 9f0194e46a2035a7e749c04369fbc7f8538660cb 1 parent c7f2ae0
@jeffkreeftmeijer jeffkreeftmeijer authored
View
4 app/assets/stylesheets/sass/application.sass.erb
@@ -244,5 +244,9 @@ strong
width: 73px
display: block
+span#submitter
+ font-size: 12px
+ color: #666
+
em
font-style: italic
View
3  app/views/contests/show.haml
@@ -2,6 +2,9 @@
- content_for(:description){ @contest.tagline }
%h2= @contest.name
+%span#submitter
+ Submitted by
+ =link_to @contest.user.login, @contest.user
= raw Kramdown::Document.new(@contest.description).to_html
View
11 spec/acceptance/contests_spec.rb
@@ -48,7 +48,8 @@
:name => 'RSpec extensions',
:description => 'Write an [RSpec](http://relishapp.com/rspec) extension that solves a problem you are having.',
:starting_on => Date.yesterday.to_time,
- :entries => [ Fabricate(:entry_with_files), @entry ]
+ :entries => [ Fabricate(:entry_with_files), @entry ],
+ :user => Fabricate(:user, :login => 'bob')
)
end
end
@@ -57,7 +58,13 @@
visit "/contests/#{@contest.slug}"
login_via_github
end
-
+
+ scenario 'see the contest submitter' do
+ page.should have_content 'Submitted by bob'
+ page.should have_link 'bob'
+ body.should include 'href="/users/bob"'
+ end
+
scenario 'read the markdown contest description' do
body.should include 'Write an <a href="http://relishapp.com/rspec">RSpec</a> extension that solves a problem you are having.'
end
Please sign in to comment.
Something went wrong with that request. Please try again.