Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes profiles rendering that would crash despite being tested.
Calling render_views should be done in all controller specs to ensure that something does not crash, otherwise, errors in the .erb files won't raise (just like now).
  • Loading branch information
Frédéric de Villamil committed Oct 12, 2013
1 parent 0659743 commit 3538949
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/views/admin/users/_form.html.erb
Expand Up @@ -121,26 +121,27 @@
</fieldset>

<% unless controller.controller_name == 'users'%>

<fieldset class='form-horizontal'>
<legend><%= _("Publish on Twitter")%></legend>
<%= twitter_disabled_message(this_blog, current_user) %>
<div class='control-group'>
<label class='control-label' for="user_twitter_account"><%= _("Twitter account")%></label>
<div class='controls'>
<%= text_field('user', 'twitter_account', {:class => 'span5', :disabled => disabled }) %>
<%= text_field('user', 'twitter_account', {class: 'span5', disabled: twitter_available?(this_blog, current_user)}) %>
<p class='help-block'>The Twitter account you want to post with</p>
</div>
</div>
<div class='control-group'>
<label class='control-label' for="user_twitter_oauth_token"><%= _("Twitter oauth token")%></label>
<div class='controls'>
<%= text_field('user', 'twitter_oauth_token', {:class => 'span5', :disabled => disabled}) %>
<%= text_field('user', 'twitter_oauth_token', {class: 'span5', disabled: twitter_available?(this_blog, current_user)}) %>
</div>
</div>
<div class='control-group'>
<label class='control-label' for="user_twitter_oauth_token_secret"><%= _("Twitter oauth secret")%></label>
<div class='controls'>
<%= text_field('user', 'twitter_oauth_token_secret', {:class => 'span5', :disabled => disabled}) %>
<%= text_field('user', 'twitter_oauth_token_secret', {class: 'span5', disabled: twitter_available?(this_blog, current_user)}) %>
</div>
</div>
</fieldset>
Expand Down
1 change: 1 addition & 0 deletions spec/controllers/admin/profiles_controller_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'

describe Admin::ProfilesController do
render_views
let!(:blog) { create(:blog) }

let(:alice) { create(:user, login: 'alice', profile: create(:profile_admin, label: Profile::ADMIN)) }
Expand Down

0 comments on commit 3538949

Please sign in to comment.