Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23428 from code-dot-org/staging
DTT (Staging > Test) [robo-dtt]
- Loading branch information
Showing
14 changed files
with
171 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import React, {PropTypes, Component} from 'react'; | ||
import i18n from '@cdo/locale'; | ||
import moment from 'moment'; | ||
|
||
const styles = { | ||
content: { | ||
padding: 10 | ||
}, | ||
header: { | ||
fontWeight: 'bold', | ||
paddingRight: 5 | ||
} | ||
}; | ||
|
||
export default class FeedbacksList extends Component { | ||
static propTypes = { | ||
feedbacks: PropTypes.arrayOf(PropTypes.shape({ | ||
teacher_name: PropTypes.string.isRequired, | ||
created_at: PropTypes.string.isRequired, | ||
comment: PropTypes.string.isRequired | ||
})).isRequired | ||
}; | ||
|
||
render() { | ||
return ( | ||
<div> | ||
{this.props.feedbacks.map((feedback, i) => ( | ||
<div style={styles.content} key={i}> | ||
<div> | ||
<span style={styles.header}>{i18n.feedbackFrom({teacher: feedback.teacher_name})}</span> | ||
{i18n.fromWhen({when: moment(feedback.created_at).fromNow()})} | ||
</div> | ||
<div>{feedback.comment}</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
dashboard/test/controllers/registrations_controller_integration_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
require 'test_helper' | ||
|
||
class RegistrationsControllerIntegrationTest < ActionDispatch::IntegrationTest | ||
test "migrate_to_multi_auth fails when signed out" do | ||
get '/users/migrate_to_multi_auth' | ||
assert_redirected_to '/users/sign_in' | ||
assert_equal '/users/migrate_to_multi_auth', session[:user_return_to] | ||
end | ||
|
||
test "migrate_to_multi_auth migrates an unmigrated user" do | ||
teacher = create :teacher | ||
refute teacher.migrated? | ||
|
||
sign_in teacher | ||
get '/users/migrate_to_multi_auth' | ||
assert_redirected_to '/home' | ||
assert_equal 'Multi-auth is now enabled on your account.', flash[:notice] | ||
|
||
teacher.reload | ||
assert teacher.migrated? | ||
end | ||
|
||
test "migrate_to_multi_auth is a no-op for a migrated user" do | ||
teacher = create :teacher, :with_migrated_email_authentication_option | ||
assert teacher.migrated? | ||
|
||
sign_in teacher | ||
get '/users/migrate_to_multi_auth' | ||
assert_redirected_to '/home' | ||
assert_equal 'Multi-auth is still enabled on your account.', flash[:notice] | ||
|
||
teacher.reload | ||
assert teacher.migrated? | ||
end | ||
|
||
test "demigrate_from_multi_auth fails when signed out" do | ||
get '/users/demigrate_from_multi_auth' | ||
assert_redirected_to '/users/sign_in' | ||
assert_equal '/users/demigrate_from_multi_auth', session[:user_return_to] | ||
end | ||
|
||
test "demigrate_from_multi_auth demigrates a migrated user" do | ||
teacher = create :teacher, :with_migrated_email_authentication_option | ||
assert teacher.migrated? | ||
|
||
sign_in teacher | ||
get '/users/demigrate_from_multi_auth' | ||
assert_redirected_to '/home' | ||
assert_equal 'Multi-auth is now disabled on your account.', flash[:notice] | ||
|
||
teacher.reload | ||
refute teacher.migrated? | ||
end | ||
|
||
test "demigrate_from_multi_auth is a no-op for an unmigrated user" do | ||
teacher = create :teacher | ||
refute teacher.migrated? | ||
|
||
sign_in teacher | ||
get '/users/demigrate_from_multi_auth' | ||
assert_redirected_to '/home' | ||
assert_equal 'Multi-auth is still disabled on your account.', flash[:notice] | ||
|
||
teacher.reload | ||
refute teacher.migrated? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters